|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Bubble Sort Problems
Problem 1.1:
Trace the operation of bubble sort on the following list:
4, 7, 2, 5, 6
[Solution]
Problem 1.2:
What is the worst case scenario for bubble sort, and why?
[Solution]
Problem 1.3:
What simple modification could be made to the bubble sort algorithm that would make it
perform more efficiently on the case described above?
[Solution]
Problem 1.4:
What would happen if bubble sort didn't keep track of the number of swaps made on
each pass through the list?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||