单选题:Given a stack S and a queue Q, where S is initialized to be empt
Given a stack S and a queue Q, where S is initialized to be empty and { 1, 2, 3, 4, 5, 6 } are in Q (with 1 stored at the front end). If only the following three operations are allowed: (1) delete and print an element from Q; (2) delete an element from Q and push it onto S; (3) pop and print an element from S, which of the following output sequences is NOT possible? @[C](2)
A. 1, 2, 5, 6, 4, 3
B. 2, 3, 4, 5, 6, 1
C. 3, 4, 5, 6, 1, 2
D. 6, 5, 4, 3, 2, 1
A.1, 2, 5, 6, 4, 3
B.2, 3, 4, 5, 6, 1
C.3, 4, 5, 6, 1, 2
D.6, 5, 4, 3, 2, 1
答案:C
A. 1, 2, 5, 6, 4, 3
B. 2, 3, 4, 5, 6, 1
C. 3, 4, 5, 6, 1, 2
D. 6, 5, 4, 3, 2, 1
A.1, 2, 5, 6, 4, 3
B.2, 3, 4, 5, 6, 1
C.3, 4, 5, 6, 1, 2
D.6, 5, 4, 3, 2, 1
答案:C