《CITI》P143
3 栈与队列
题目:
3.6 Write a program to sort a stack in ascending order (with biggest items on top). You may use at most one additional stack to hold items, but you may not copy the elements into any other data structure (such as an array). The stack supports the following operations: push, pop, peek, and isEmpty.

本文介绍了一种使用单个辅助栈对原始栈进行升序排序的方法,不允许将元素复制到数组等其他数据结构中。讨论了push、pop、peek及isEmpty等基本操作的应用。
418

被折叠的 条评论
为什么被折叠?



