MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The symbol table implementation is based on the property of locality of reference is-
A
Hash Table
B
Self Organisation
C
Linear list
D
None of the above
Explanation: 

Detailed explanation-1: -Which symbol table implementation is based on the property of locality of reference? Explanation: Hash table is used as a reference for symbol table because it is efficient.

Detailed explanation-2: -Answer. 1-Self Organizing List. The aim of a self-organizing list is to improve efficiency of linear search by moving more frequently accessed items towards the head of the list. The property of frequently accessing same values, or related storage locations is termed as Locality of Reference.

Detailed explanation-3: -Symbol tables are often implemented as hash tables because a compiler must be able to store and retrieve information about symbols very quickly. Several parts of a compiler access the symbol table during various phases of the compilation process. One part, the lexical analyzer, inserts symbols.

Detailed explanation-4: -Symbol Table is an important data structure created and maintained by the compiler in order to keep track of semantics of variables i.e. it stores information about the scope and binding information about names, information about instances of various entities such as variable and function names, classes, objects, etc.

Detailed explanation-5: -Explanation: Hash table is the most efficient data structure in the case of symbol table implementation as its access time is O(1).

There is 1 question to complete.