☆─────────────────────────────────────☆
waab (waab) 于 (Mon Mar 24 17:17:01 2008) 提到:
Given a BST (Binary search Tree) how will you find median in that?
Constraints:
* No extra memory.
* Function should be reentrant (No static, global variables allowed.)
* Median for even no of nodes will be the average of 2 middle elements
and for odd no of terms will be middle element only.
* Algorithm should be efficient in terms of complexity.
Write a solid secure code for it.
我的想法:
1.是先遍