Basic Operation of Stack
Basic Operation of Stack :-
Initially all the elements of the stack are initialized to (-1), Which indicates an empty stack. The TOP variable is also initialized to (-1). At each insertion , the TOP is incremented by (1) to point to the latest stack TOP. At each deletion the TOP is decremented by (1) and the position from where the item is removed each assign to (-1) to indicate an empty cell.
Here the stack array s[ ], pointer TOP are declared globally.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment