数据结构 - 树
# 数据结构 - 树
# 二叉树经典题
# 深度优先搜索(DFS)
在这个策略中,我们采用 深度 作为优先级,以便从跟开始一直到达某个确定的叶子,然后再返回到达另一个分支。深度优先搜索策略又可以根据根节点、左孩子和右孩子的相对顺序被细分为先序遍历,中序遍历和后序遍历。
# 宽度优先搜索(BFS)
我们按照高度顺序一层一层的访问整棵树,高层次的节点将会比低层次的节点先被访问到。
# 二叉树和递归
# 其他
- [ ] maximum-depth-of-binary-tree (opens new window)
- [ ] balanced-binary-tree (opens new window)
- [ ] binary-tree-maximum-path-sum (opens new window)
- [ ] lowest-common-ancestor-of-a-binary-tree (opens new window)
- [ ] binary-tree-level-order-traversal (opens new window)
- [ ] binary-tree-level-order-traversal-ii (opens new window)
- [ ] binary-tree-zigzag-level-order-traversal (opens new window)
- [ ] validate-binary-search-tree (opens new window)
- [ ] insert-into-a-binary-search-tree (opens new window)
# 二叉搜索树经典题
📝 帮助改善此页面! (opens new window)
上次更新: 2024/01/27, 23:05:50