Symbol Table Organizations
Linear, Unsorted:
Symbols are stored in an array; new symbols are inserted at the end.
Insert: | O(1) | |
Search: | O(n) | Search half the table on average. |
Linear, Sorted:
Symbols are stored in an array that is sorted ( e.g., alphabetically).
Insert: | O(n) | Move half the table on average. |
Search: | O(log n) | Binary search. |