|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Selection Sort Problems
Problem 1.1:
Why is selection sort's efficiency independent of the data being sorted?
[Solution]
Problem 1.2:
Consider the following list: (4, 3, 8, 22, 1, 5). What will this list
look like after the first swap?
[Solution]
Problem 1.3:
Imagine the following implementation of selection sort: instead of
selecting the smallest element and putting it at the front, we instead
select the largest element and put it at the end of the list. Does this
change the algorithm's efficiency?
[Solution]
Problem 1.4:
When would bubble sort be a better algorithm to use than selection sort?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||