322 views
0 votes
0 votes
We want to perform reversal of a stack, which mean reversing the contents of the stack and placing it on the same stack.
For example if Stack S contains 1 2 3, where 1 being on the top of the stack, then same stack after reversal will contain 3 2 1, where 3 being on the top of the stack. Which of the following statements is/are correct? Consider that system stack is not to be counted.
(i) This can be achieved using one queue.
(ii) We need one more stack for reversal of the stack.
(iii) We don’t need any extra stack.
(iv) We need at least two more stacks.

Please log in or register to answer this question.

Related questions

–1 votes
–1 votes
0 answers
1
himgta asked Sep 12, 2018
317 views
0 votes
0 votes
1 answer
2
himgta asked Sep 11, 2018
956 views
Evaluate the given prefix expression,And find the result the of the expression?Say +-*+ABCD*AB ,Where A=4,B=3,C=2,D=5.Answer is 3 or 21??
0 votes
0 votes
0 answers
4
himgta asked Apr 13, 2018
289 views
The number of binary search tree’s with 4 nodes (1, 2, 3, 4) possible where in every binary search tree ‘1’ is leaf node are .....How to solve such type of question...