Professional Documents
Culture Documents
Stack Implementation
Stack Implementation
Stack Implementation
stack=list()
size=int(input('enter the size of stack'))
while True:
print('press 0 for push \npress 1 for pop \npress 2 for traversal')
ch=int(input('enter your choice'))
if ch==0:
do_push()
elif ch==1:
do_pop()
elif ch==2:
do_traversal()
else:
print('invalid choice')