previous | start | next

Preview Symbol Table Implementations

Underlying Data Structure Implementing Class Advantages Disadvantages
linked list SequentialSearchST Ok for small number of keys Unacceptable performace for large number of keys
array BinarySearchST Good search performance
implements ordered symbol table
Insert (put) is too slow
binary search tree BST Very good search and insert provided keys inserted random order
relatively easy to implement
implements ordered symbol table
Can degenerate and be as bad as linked list
balanced binary search tree RedBlackST or AvlST Guarantees good search and insert
implements ordered symbol table
methods are more complicated to implement.
hash table SeparateChainHashST Provides even better search and insert performance Does NOT implement ordered symbol table
Requires "good" hash function exist for the Key type.


previous | start | next