|
|
Step # 1: Define Library files
Step # 2: construct class Stack
Step # 3: Define data type, private and public
Step # 4: Constructor where top=-1i.e the stack should be
Step # 5: For push of element, top is incremented as top++
Step # 6: For pop of element ,decrement in top as top
Step # 7: Print all elements in stack
Step # 8: End of programme |