Assigned Reading:
Handouts (available on-line):
Topics Covered: This lecture and the next one is on Binary Search Trees (BST).
The assumption here is that the keys can be ordered (e.g., the keys might be integers). For example, in Figure 1, an inorder walk of the tree will produce the keys 1, 2, 3, 5, 7, 9, 10.
Fig 1. A binary search tree |
Fig 2. Another binary search tree |
Fig 3. After inserting 6 and 8. |
Fig 4. A BST before and after deleting 3. |
Fig 5. A BST before and after deleting 2. |
Fig 6. A BST before and after deleting 7. |