Question: Describe an algorithm using pseudocode as discussed in class that takes a list of n integers a1, a2,..., an, and returns the number of
Describe an algorithm using pseudocode as discussed in class that takes a list of n integers a1, a2,..., an, and returns the number of negative integers in the list. Hint: the initial value of the counter should be 0. 2. (4 points) The bubble sort algorithm discussed in class is used to sort the following sequence of integers: 11 6 18 48 15 12 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?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
