Chapter 9: Search Trees I

We study several alternative data structures based on trees for realizing ordered dictionary. The fundamental operations in an ordered dictionary ADT are:

9.1 Binary Search Trees

BinarySearchTrees.pdf  5
Inorder traversal visits the keys of its dictionary in nondecreasing order.

9.1.1 Searching

BinarySearchTrees.pdf  6

Analysis of Binary Tree Searching
Function find(k) on dictionary D runs O(h) time, where h is the height of the binary search tree T used to implement D.

9.1.2 Update Operations

Insertion
BinarySearchTrees.pdf  7

Removal
BinarySearchTrees.pdf  8, 9

Best-case versus Worst-case
BinarySearchTrees.pdf  10

9.1.3 C++ Implementation

A Binary Search Tree in C++
html-9.2 (Position)
html-9.3 (BST1)
html-9.4 (BST2)
html-9.5 (BST3)
html-9.6 (BST4)

except.h  -   LBTree.h   -   BSTree.cpp

9.1.4 Performance