+3 votes
in Class 12 by kratos

Explain the memory representation of stack data structure using arrays.

1 Answer

+1 vote
by kratos
 
Best 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.

...