Learning objectives
After this class, you should be able to:
- Given a sequence of
n
integers, a numberk
in[1,n]
, and a sequence of random numbers, show the steps involved in applying the randomized selection algorithm discussed in class to find thek
th smallest of these numbers.- Analyze the time complexity of the randomized selection algorithm discussed in class.
Reading assignment
- Class notes on randomized selection.
- Review binary search trees and balanced binary search trees (CLR: Chapters 12 and 13).
Exercises and review questions
- Questions on current lecture's material
- (Post your answer on the discussion board) Show how the randomized selection algorithm that we discussed in class would determine the
4
th smallest number of the following sequence: 1 4 3 2 6 0 7 5. Use a sequence of random numbers generated by any of the Unix random number generators, and show this sequence too.- Questions on next lecture's material
- (Post your answer on the discussion board) Give an example of a binary tree with at least eight nodes, and show how you would search for an element in that tree.
- What is the time complexity of a search in a binary search tree?