|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Merge Sort Problems
Problem 1.1:
In the course of a merge sort on a 64 element list, how many times must
the list be split?
[Solution]
Problem 1.2:
Consider the following pairs of lists:
Problem 1.3:
Below is an 8 element list that has been broken down into 8 one element
lists. Show the merging of the lists to form and ordered list.
(6), (3), (8), (2), (9), (1), (5), (7)
[Solution]
Problem 1.4:
The list above required 7 merges to be sorted. In general, how many merges
will be performed in an n element list (for the sake of simplicity, assume
that n is a power of 2)?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||