Which of the following permutations can’t be obtained in the output (in the…
Which of the following permutations can’t be obtained in the output (in the same order) using a dequeue assuming that the input is the sequence 1, 2, 3, 4, 5 is that order?
Answer: D. None of the above — Since options 1, 2, and 3 are all completely valid permutations that a dequeue can produce, none of them violate the restrictions. Therefore, 4) None of the…
- A.
3, 2, 1, 4, 5
- B.
4, 5, 2, 1, 3
- C.
4, 2, 1, 3, 5
- D.
None of the above
Attempted by 127 students.
Show answer & explanation
Correct answer: D
Since options 1, 2, and 3 are all completely valid permutations that a dequeue can produce, none of them violate the restrictions. Therefore, 4) None of the above is the right choice.
Loading lesson…