演算法總結-二叉樹的深度優先搜尋
1 遍歷的問題
二叉樹的前序遍歷
http://www.lintcode.com/zh-cn/problem/binary-tree-preorder-traversal/
二叉樹的中序遍歷
http://www.lintcode.com/zh-cn/problem/binary-tree-inorder-traversal/
二叉樹的後序遍歷
http://www.lintcode.com/zh-cn/problem/binary-tree-postorder-traversal/
分治法
二叉樹的最大深度
http://www.lintcode.com/zh-cn/problem/maximum-depth-of-binary-tree/
二叉樹的所有路徑
http://www.lintcode.com/zh-cn/problem/binary-tree-paths/
最小子樹
http://www.jiuzhang.com/solutions/minimum-subtree/
平衡二叉樹
http://www.lintcode.com/zh-cn/problem/balanced-binary-tree/
具有最大平均數的子樹
http://www.jiuzhang.com/solutions/subtree-with-maximum-average/
最近公共祖先
http://www.lintcode.com/zh-cn/problem/lowest-common-ancestor/
驗證二叉查詢樹
http://www.lintcode.com/zh-cn/problem/validate-binary-search-tree/
將二叉查詢樹轉換成雙鏈表
http://www.lintcode.com/zh-cn/problem/convert-binary-search-tree-to-doubly-linked-list/
將二叉樹拆成連結串列
http://www.lintcode.com/zh-cn/problem/flatten-binary-tree-to-linked-list/