Open In App

Various implementations of Symbol Table

Symbol Table is an important data structure that is created and maintained by the compilers in order to track information about the occurrences of various entities such as variable names, objects, function names, interfaces, etc. The information that is collected by the compiler inside the symbol table in the analysis phase is used by the synthesis phase to generate the target code.

Comparison between different implementations of Symbol Table :



1. Array (Sorted) :

2. Linked List :



3. Unordered List :

Disadvantages of using Array, Linked Lists, or Unsorted Lists for symbol table implementations :

4. Self-organizing List :

Disadvantages of using Self-organizing Lists for symbol table implementations :
The disadvantage in this implementation is that whenever less frequent elements are searched then the performance becomes poor.

5. Search Trees (Balanced) :

Disadvantages of using Search Trees for symbol table implementations :
The disadvantage of this implementation is that the tree always has to be kept balanced.

6. Hashing :

Disadvantages of using Hashing for symbol table implementations :
The disadvantage of this implementation is when there are too many collisions the time complexity increases to O(n).

Thus, we can see that every implementation of the symbol table is unique and has its own disadvantages. The implementer according to its requirements can choose any of the above implementations of Symbol Tables.

Article Tags :