请大虾验证!# Programming - 葵花宝典
l*l
1 楼
俺在 JOBHUNTING 做的一道题, 不知是否正确, 请大虾验证!
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.
How about this?
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.
How about this?