Describe using pseudocode as described in class an


1. Describe using pseudocode as described in class an algorithm that takes a list of n integers a1, a2, ..., an, and finds the average of all negative integers in the list. Be sure to initialize the variables.

2. The bubble sort algorithm discussed in class is used to sort the following sequence of integers: 3 22 14 21 70 79

  • How many passes must the algorithm perform to guarantee the entire sequence is sorted?
  • What is the list obtained after the first pass?
  • What is the list obtained after the third pass?
  • What is the list obtained after the final pass?

3. Show how the binary search algorithm discussed in class searches for 48 in the sorted list below: 8 25 31 32 39 45 54 63 67 71 88 94

Solution Preview :

Prepared by a verified Expert
Business Management: Describe using pseudocode as described in class an
Reference No:- TGS02944432

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)