Question DSA-STK-0018
HardA stack receives push(1), push(2), push(3) in that order, with pops allowed at any time. Which output sequence is impossible?
- A.
3 2 1
- B.
3 1 2
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Stacks question
A stack receives push(1), push(2), push(3) in that order, with pops allowed at any time. Which output sequence is impossible?
3 2 1
3 1 2
Sign up free to see the answer and a step-by-step explanation.
2 3 1
1 2 3