in DS
324 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.
in DS
by
324 views

4 Comments

if the stacks are not identical, then option D is correct

if the stacks are identical, then Option B is correct.
1
1

@Shaik Masthan

brother answer given 1 and 3  are correct.....please clarify!

0
0
post their solution
0
0

@Shaik Masthan

This is the soln

0
0

Please log in or register to answer this question.