Computer Science 331 — Search Trees
Finite sets and mappings are basic abstract data types with many applications. If the elements of a set, or the keys in a mapping, belong to an ordered set, then additional useful operations can be provided, so that finite ordered sets and dictionaries (ordered mappings) are also heavily used.
Binary trees are extremely useful data structures. If the elements of an ordered set or of a dictionary are stored at nodes, with various ordering properties satisfied,then the resulting binary search trees provide extremely useful implementations.
While binary search trees have very good performance in practice, the worst case running times of operations are not as good. “Height balanced” binary search trees are somewhat more complicated data structures with operations whose worst case performance is within a linear factor of the “expected” performance of the corresponding operations on a regular binary search tree. A red-black tree is one kind of height balanced search tree.
Regular binary search trees and red-black trees will be presented, and their properties will be studied.