Multiple choice

Which of the following data structures is usually used in compiler implementations to look up identifiers?

  1. B-tree

  2. Hash table

  3. Dequeue

  4. Set

  5. Bitmap

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Compiler implementations usually use hash tables to look up identifiers. A hash table (also hash map) is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.