m***t 发帖数: 254 | 1 考古考来的面试题。
Design a data structure, this data structure have four functions: pop, push
, min, top. DO NOT use any stack, queue, list, array or things like this.
什么都不让用怎么做啊? | t****t 发帖数: 6806 | 2 不让用现成的.自己写.
push
【在 m***t 的大作中提到】 : 考古考来的面试题。 : Design a data structure, this data structure have four functions: pop, push : , min, top. DO NOT use any stack, queue, list, array or things like this. : 什么都不让用怎么做啊?
| m***t 发帖数: 254 | 3 那如果用C, 自己用typedef struct定义的link list算自己写的还是现成的?如果算
自己写的是不是太简单了, pop,
push, top复杂度都是constant, min扫一遍,复杂度linear。 如果这算现成的,那真
不知道怎么做了。
【在 t****t 的大作中提到】 : 不让用现成的.自己写. : : push
| k****f 发帖数: 3794 | 4 是不是min-heap?
push
【在 m***t 的大作中提到】 : 考古考来的面试题。 : Design a data structure, this data structure have four functions: pop, push : , min, top. DO NOT use any stack, queue, list, array or things like this. : 什么都不让用怎么做啊?
| m***t 发帖数: 254 | 5 That makes sense. Thanks!
【在 k****f 的大作中提到】 : 是不是min-heap? : : push
|
|