[合集] 【讨论】两道非常难的Google面试题# JobHunting - 待字闺中
m*n
1 楼
☆─────────────────────────────────────☆
fololunsia (我心飞扬) 于 (Fri May 4 22:20:51 2007) 提到:
都是堆栈操作
1. Design an efficient algorithm to sort elements in a stack in either
ascending/descending order, using only pop(), top(), push(), isEmpty(),
isFull(). Do not use any auxiliary stacks or arrays.
2. 如何高效地用 two 堆栈 to simulate a 队列 要求O(1)时间内。
☆─────────────────────────────────────☆
observer (笑看人生) 于 (Fri May 4 22:31:11 2007) 提到:
~~~~~~~~~~~~~~~~~~how ab
fololunsia (我心飞扬) 于 (Fri May 4 22:20:51 2007) 提到:
都是堆栈操作
1. Design an efficient algorithm to sort elements in a stack in either
ascending/descending order, using only pop(), top(), push(), isEmpty(),
isFull(). Do not use any auxiliary stacks or arrays.
2. 如何高效地用 two 堆栈 to simulate a 队列 要求O(1)时间内。
☆─────────────────────────────────────☆
observer (笑看人生) 于 (Fri May 4 22:31:11 2007) 提到:
~~~~~~~~~~~~~~~~~~how ab