Contents    Page-10    Prev    Next    Page+10    Index   

Indexed Buckets

A symbol is used to index a table, which provides a pointer to a linked list of symbols.

Hashed with Buckets:
A hashing function is used to index the table of buckets.

Insert: O(1)
Search: O(n) Actually n / (2 · nb)
nb (number of buckets) can be large.
Since pointers are used for the linked list of symbols, the table can be expanded by requesting more memory.

Alphabetized Buckets:
The first character of first few characters of a symbol are used to index the table of buckets.

Insert: O(n) Linked list is sorted
Search: O(n) Actually n / (2 · nb)
Some letter combinations are much more common, so some bucket entries will be empty. Symbols are in a sorted order.