Question: (15 pts) Assume that an integer array A is initialized to {93, 8, 21, 61, 74, 3, 57, 59, 84, 99}. Answer the following questions.

 (15 pts) Assume that an integer array A is initialized to

(15 pts) Assume that an integer array A is initialized to {93, 8, 21, 61, 74, 3, 57, 59, 84, 99}. Answer the following questions. (a) (5 pts) Which pair of numbers in A is first swapped if selection soit is run on A? Which pairs of numbers are compared by selection sort before the first swapping? (b) (5 pts) Show the content of the array A after the InsertionSortInterleaved function used by the shell sort is run on (A, 10, 0, 3). Note here that parameter 3 represents the gap value. (c) (5 pts) Which pair of numbers in A is the first swapped by the partition procedure used by quicksoit as given in the zyBook? Which pairs of numbers are compared by quicksort before the first swapping? Following zyBook, if partition is run on an (sub)array with start index low and end index high, then the index of the pivot element chosen by partition is low + (high low)/2

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 Databases Questions!