1 describe sing pseudocode an algorithm that takes a list


1. Describe sing pseudocode an algorithm that takes a list of n integers a1, a2, ..., an, and finds the sum of all positive integers in the list.

2. The bubble sort algorithm discussed in class is used to sort the following sequence of integers: 74 21 57 86 51 85

  • How many passes will 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 12 in the sorted list below: 1 8 21 25 31 36 39 40 49 69 92 99

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: 1 describe sing pseudocode an algorithm that takes a list
Reference No:- TGS02681396

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)