Question: For k Z+, let n = 2k, and consider the list L: a1, a2, a3, ..., an. To sort L in ascending order, first

For k ∈ Z+, let n = 2k, and consider the list L: a1, a2, a3, ..., an. To sort L in ascending order, first compare the entries at and al+(n/2), for each 1 ≤ i ≤ n/2. For the resulting 2k-1 ordered pairs, merge sort the ith and (i + (n/4))-th ordered pairs, for each 1 ≤ i ≤ n/4. Now do a merge sort on the ith and (i + (n/8))-th ordered quadruples, for each 1 ≤ i ≤ n/8. Continue the process until the elements of L are in ascending order.
(a) Apply this sorting procedure to the list
L: 11, 3, 4, 6, - 5, 7, 35,
- 2, 1, 23, 9, 15, 18, 2, - 10, 5.
(b) If n = 2k, how many comparisons at most does this procedure require?

Step by Step Solution

3.42 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a 1 11 3 23 4 9 6 15 5 18 2 7 10 35 2 ... View full answer

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

Document Format (1 attachment)

Word file Icon

954-M-L-A-L-S (8317).docx

120 KBs Word File

Students Have Also Explored These Related Linear Algebra Questions!