Data structure used in compiling

Two types of data structures used in a compiler are:
  1. Stack
  2. Heap

Stack
  • The stack is a linear data structure.
  • It follows LIFO (Last in First Out) rule.
  • Each time a procedure is called, space for its local variables is pushed onto a stack, and when the procedure terminates, space is popped off the stack.

Heap
  • The heap data structure permits allocation and deallocation of entities in a random order.
  • Heap is nonlinear data structure.
  • When a program makes an allocation request, the heap manager allocates a memory area and returns its address.
  • The program is expected to save this address in a pointer and use it to access the allotted entity.
  • When a program makes a deallocation request, the heap manager deallocates a memory area.
Data structure used in compiling

Download the Android app to get all Government Job Notifications on your Mobile.
Download Now
Important: Please always Check and Confirm the above details with the official Advertisement / Notification.
Previous Post Next Post