Basic Operation of Stack

No comments

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. 


No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀