摘要:
Note: // 在root为根的二叉树中找A,B的LCA: // 如果找到了就返回这个LCA // 如果只碰到A,就返回A // 如果只碰到B,就返回B // 如果都没有,就返回null Just consider relationship between left, right and root 阅读全文
摘要:
Note: It is easier to use divided conquer. As you can see, the question is just to add right to left's last. Here we care more about last then the top 阅读全文
摘要:
Node: Quick Select: Avg O(N) Thought: put all the element less(more) than pivot to the first part, the rest to the second part. And Kth only falls to 阅读全文