-
某堆栈的输入序列为a,b,c,d,下面的四个序列中,不可能是它的输出序列的是()
a,c,b,d
b,c,d,a
c,d,b,a
d,c,a,b ...
阅读题目
单选题
经典指数
-
-
Given a stack which can keep M numbers at most. Push N numbers in the
order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if
a given sequence of numbers is a possible pop sequence of the stack.
For example, if M is 5 and N is 7, we can obtain 1, 2, 3, 4, 5, 6, 7
from the stack, but not 3, 2, 1, 7, 5, 6, 4.
输入描述:
Each input file contains one test case. For each case, the first line contains 3 numbers (all no more than 1000): M (the maximum capacity of the stack), N (the length ...
阅读题目
面试题
经典指数
-
-
-
-
-
-
-
扫描后移动端查看
相关标签
同类标签
|
微信公众号
|
|
欢迎加入,一起群聊
|