Question: Consider the following array: 4 0 6 3 6 4 2 8 7 6 2 4 5 6 6 9 9 3 0 3 1

Consider the following array:40636428762456699303157Note: For quicksort you will use a different set of numbers, because these resulted in pivots being the largest or smallest item too often. For quicksort use these numbers instead:1372043288663503293640For problems 1-5, create a diagram showing the state of the array above after each pass through the array using the following sorting algorithms. (In other words, use the method used in lecture to show how each sorting algorithm sorts the numbers above.) Also, for each algorithm, state the average big-O running time estimate.For consistency, please use the algorithm as shown in the lecture, not in the text.Selection SortBubble Sort (No swap flag. In other words, no stopping early when the list is sorted.)Insertion SortMerge SortQuicksort. You must use the version given in the lesson and circle the pivot at each step.6. List each number from the unsorted list above (the list that starts with 40) that will be examined if a linear search is used to search for the number 62. Also state the average big-O running time estimate for a linear search.7. Here are the same numbers but sorted:023031404557626364668799List each number from the list above that will be examined if a binary search is used to search for the number 99.8. List each number from the list above that will be examined if a binary search is used to search for the number 52. Note that 52 is not in the list. That doesn't change anything. There is still a sequence of numbers that are examined until the algorithm determines that it isn't there.9. State the average big-O running time estimate for binary search.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!