Answered You can hire a professional tutor to get the answer.

QUESTION

Descrete Computational Analysis Sorting Algorithm MUST SHOW WORK, Class Example/Notes included Thank you! Three Question's 1.

Descrete Computational Analysis

Sorting Algorithm

MUST SHOW WORK, Class Example/Notes included

Thank you!

Three Question's

1. (3 points) - 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. (4 points) - 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. (3 points) - 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

Bubble Sorting:

procedure bubblesort(

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question