Which of the following permutation can be obtained in the same order using a stack assuming that input is the sequence 3, 4, 2, 1, 5 in that order?
Note: Any element can be pushed only once in the stack.
(A) 2, 1, 3, 4, 5
(B) 5, 3, 4, 2, 1
(C) 1, 5, 3, 4, 2
(D) 2, 1, 5, 4, 3
Answer: (D)
Explanation: https://www.neveropen.co.uk/stack-permutations-check-if-an-array-is-stack-permutation-of-other/
Quiz of this Question

… [Trackback]
[…] Here you will find 61934 more Info to that Topic: geeksforgeeks.org/algorithms-quiz-sp-contest-3-question-3/ […]
… [Trackback]
[…] Info to that Topic: geeksforgeeks.org/algorithms-quiz-sp-contest-3-question-3/ […]
… [Trackback]
[…] Here you can find 41696 additional Information on that Topic: geeksforgeeks.org/algorithms-quiz-sp-contest-3-question-3/ […]
… [Trackback]
[…] Info on that Topic: geeksforgeeks.org/algorithms-quiz-sp-contest-3-question-3/ […]
… [Trackback]
[…] Read More Information here on that Topic: geeksforgeeks.org/algorithms-quiz-sp-contest-3-question-3/ […]