PAT (Advanced Level) 刷题记录 1051 Pop Sequence (25分) 模拟堆栈
1051 Pop Sequence (25分)
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 a
原创
2020-05-10 11:44:36 ·
146 阅读 ·
0 评论