2017年6月2日

摘要: Note: // 在root为根的二叉树中找A,B的LCA: // 如果找到了就返回这个LCA // 如果只碰到A,就返回A // 如果只碰到B,就返回B // 如果都没有,就返回null Just consider relationship between left, right and root 阅读全文
posted @ 2017-06-02 08:03 codingEskimo 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-06-02 06:54 codingEskimo 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-06-02 06:09 codingEskimo 阅读(109) 评论(0) 推荐(0) 编辑

导航