|
ADS
Algorithms and Data Structures
|
The threaded binary search tree of Perlis and Thornton, beyond the book. More...
Files | |
| file | ADS/tree/ThreadedTree.h |
| The threaded binary search tree of Perlis and Thornton, beyond the book: a missing left child is replaced by a link (a thread) to the predecessor in symmetric order, and a missing right child by a thread to the successor, a bit of each node telling a child from a thread; the symmetric visit then needs neither a stack nor the recursion, the successor of a node being its right thread or the leftmost node of its right subtree (Algorithm S of Knuth, section 2.3.1), in \( O( 1 ) \) amortized time each. | |
Classes | |
| class | ADS::ThreadedTree< K > |
| a binary search tree with threads in symmetric order More... | |
The threaded binary search tree of Perlis and Thornton, beyond the book.
The definitions, the invariants and the costs of the area are in Theory of trees.