|
Stacks->Array Implementation->Pop operation |
||
| POP is the synonym
for delete when it comes to Stack. So, if you're taking an array as the
stack, remember that you'll return an error message, "Stack
underflow", if an attempt is made to Pop in an empty Stack. OK.
Algorithm:- C implementation:- int push() Note:- Step-2:(b) signifies that the respective element has been deleted. In array implementation, I have taken TOP = -1 to signify the empty stack. This simplifies your implementation. Related Operations: |
||
| Index || Doubts / Clarifications || Related Topics || Web Links | ||