Machine-translated by Google. Questions are authored in English.
Top

Discussion

A hash table combined with a scope stack is a common design because

  • A.it gives fast lookup and cheap scope entry and exit together
  • B.it removes the need to store the name in each entry
  • C.it guarantees that no two names will ever collide
  • D.it allows the table to be shared between separate compilations

Answer: A

Each bucket chain is ordered most recent first, so a lookup finds the innermost declaration immediately. Popping a scope removes entries from the fronts of their chains. Both operations therefore cost time proportional only to what changed.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.