Question 10294 – Theory-of-Computation
March 7, 2024
Question 1743 – Database-Management-System
March 8, 2024
Question 10294 – Theory-of-Computation
March 7, 2024
Question 1743 – Database-Management-System
March 8, 2024

Question 10274 – Data-Structures

Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is the sequence 1, 2, 3, 4, 5 in that order?

Correct Answer: B

Question 2 Explanation: 
Push 1 Push 2 Push 3 Pop 3 Push 4 Pop 4 Push 5 Pop 5 Pop 2 Pop 1.
→ Remaining options are not possible.
A
3, 4, 5, 1, 2
B
3, 4, 5, 2, 1
C
1, 5, 2, 3, 4
D
5, 4, 3, 1, 2
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!