Learning objectives
After this class, you should be able to:
- Given a sequence of
n
integers, a number k
in [1,n]
, and a sequence of random numbers, show the steps involved in applying the randomized selection algorithm discussed in class to find the k
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.
Exercises and review questions
- Questions on current lecture's material
- 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
- 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?
Last modified: 28 Jul 2004