Discussion
Symbol table lookup is usually implemented with a hash table because
Answer: A
Correct answer: names must be found quickly and are looked up very frequently
Every identifier in the program is looked up at least once and usually several times, across several phases, so the lookup is on the compiler's hot path.
A hash table gives near constant time, where a linear list would give time proportional to the number of names. The trade is that ordering is lost, which is why scope handling uses a stack of tables or a chain of them alongside. No standard prescribes the structure; speed alone recommends it.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development