|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Quick Sort Problems
Problem 1.1:
Consider the case where every pivot quick sort picks divides the list into
one empty list and one list containing elements all greater than the pivot.
This degenerate case of quick sort is equivalent to which other sorting
algorithm?
[Solution]
Problem 1.2:
Explain why a sophistocated pivot selection method can be helpful to the
efficiency of quick sort.
[Solution]
Problem 1.3:
Consider the implementation of quick sort given in the
summary. Why is that implementation inefficient
for the list: (9, 8, 7, 6, 5, 4, 3, 2, 1)?
[Solution]
Problem 1.4:
Why don't we just search through the data set each time we need to find a
pivot and select one that will divide the data set roughly in half?
[Solution]
Problem 1.5:
In terms of big-O notation, is quick sort's best case any better than merge
sort?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||