讨论个常见的面试题:一个数据流里面随时找出median# JobHunting - 待字闺中
i*n
1 楼
method 1: keep a balanced binary search tree
method 2(theoretically work): keep a min heap, a max heap, keep it balanced
and all elements in min heap > all elements in max heap (tricky to solve
this, still figuring out)
Welcome to discuss an efficient way ha~
method 2(theoretically work): keep a min heap, a max heap, keep it balanced
and all elements in min heap > all elements in max heap (tricky to solve
this, still figuring out)
Welcome to discuss an efficient way ha~