0
Stack
i need help with my code..i want to make a programme to take q queries and check if s equql to push then add x in the top of the stack ..if s equal to pop then remove the top of the stack..if s.equal to top then print the top of the stack . example: input 10 push 5 top push 6 pop push 3 top pop top pop top output 5 6 3 6 5
2 Respostas
+ 2
You need to try and post your tried code..
Or This may help you.. See...
https://www.sololearn.com/learn/646/?ref=app
+ 2
Use the stl stack class which comes with methods like pop push and top so you don't have to atleast worry about writing all that from scratch