Question: 10. [Question total: 6 ma (a) [3 marks] How many key comparisons will be done during a 7-sort (that is, shellsort with h =

10. [Question total: 6 ma (a) [3 marks] How many key comparisons

 

10. [Question total: 6 ma (a) [3 marks] How many key comparisons will be done during a 7-sort (that is, shellsort with h = 7) of a list of 21 numbers if the keys in the initial list are in sorted order (and each key is unique)? (This is just for the 7-sort phase, not the complete sort). (b) [3 marks] How many comparisons would a 1-sort take on the list that results from the 7-sort in the previous part?

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!