Question: 1. Describe using pseudocode as described in class an algorithm that takes a list of n integers a1, a2, ..., an, and counts the number
1. Describe using pseudocode as described in class an algorithm that takes a list of n integers a1, a2, ..., an, and counts the number of even 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: 38 19 6 50 24 21 33 43
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: 7 12 15 17 19 21 25 26 29 40 46 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
