Difference between symbol table and Hash map data structures

When reading various data structures, it turned out that the symbol table used by the compilers is classified as a data structure.

Can someone explain what is the difference between symbol table data structure and hash map?

+4


source to share


2 answers


The symbol table itself is not a data structure. Most compilers will need one or more symbol tables, but their exact form is not limited to one particular data structure. Some compilers may implement their symbol table as a hash map if that suits their purpose.

So I would say the difference is conceptual. The "Symbol Table" describes the structure of the data by purpose. A "hash map" describes the data structure as it is implemented.



Wikipedia page is not that bad

+3


source


First of all, Symbol table

it is not a data structure. Symbol table

is an Abstract Data Type (ADT) in computer science. Another common name for this ADT is dictionary.

The ADT implementation is called a data structure. There are many implementations (called data structures) of Symbol Table

ADT. One such implementation is a hash map. Various possible implementations, Symbol Table

but are not limited to them, are as follows:



  • Unordered array implementation
  • Ordered (sorted) array implementation
  • Unordered linked list implementation
  • Ordered implementation of linked list
  • Binary Search Tree Implementation
  • Balanced Binary Search Tree Implementation
  • Ternary search implementation
  • Hash based implementation - like Hash Map

Note : you can also read this thread to understand the difference between ADT and data structure.

+4


source







All Articles