1.

Explain the memory representation of stack data structure using arrays.

Answer»

The items into the stack are stored in sequential order from the first location of the memory block.
A pointer TOP contains the location of the top element of the stack.

A variable MAXSTK contains the maximum number of elements that can be stored in stack.
The stack is full when TOP = MAXSTK
The stack is empty when TOP = 0.



Discussion

No Comment Found

Related InterviewSolutions