Binary Tree

题型总结

1. Quick Sort 类

  • Partition Array

2. 分治递归解决二叉树

  • lc236 Lowest Common Ancesstor 经典问题,退出条件一定要想清楚:如果 root == p 或者 root == q就可返回 root

  • lc104 Maximum Depth of Binary Tree

  • lc110 Balanced Binary Tree

3. DFS / BFS 解决二叉树问题

  • DFS template: 两个 template,选哪个都可以

  • lc102 Binary Tree level order traversal

4. Binary Search Tree 类的问题

Last updated