二叉搜索树 & 二叉树 & 遍历方法

时间:2023-03-09 18:46:09
二叉搜索树 & 二叉树 & 遍历方法

二叉搜索树 & 二叉树 & 遍历方法

二叉搜索树

BST / binary search tree

https://en.wikipedia.org/wiki/Binary_search_tree

二叉搜索树 & 二叉树 & 遍历方法


8
/ \
3 10
/ \ \
1 6 14
/ \ /
4 7 13 // 先序遍历
8 -> 1 -> 3 -> 4 -> 6 -> 7 -> 13 -> 14 -> 10 // 中序遍历
1 -> 3 -> 4 -> 6 -> 7 -> 8 -> 13 -> 14 -> 10 // 后序遍历
13 -> 14 -> 10 -> 1 -> 3 -> 4 -> 6 -> 7 -> 8

二叉树

遍历方法

先序遍历, 左子树=> 根节点 => 右子树

中序遍历, 根节点 => 左子树 => 右子树

后序遍历, 左子树 => 右子树 => 根节点

  1. 满二叉树
  2. 完全二叉树
  3. 红黑树
  4. AVL 树

Algorithm Visualizations

算法可视化

二叉搜索树 & 二叉树 & 遍历方法

https://www.cs.usfca.edu/~galles/visualization/BST.html

Animation Library

https://www.cs.usfca.edu/~galles/visualization/AnimationLibrary/

二叉搜索树 & 二叉树 & 遍历方法

OOP



refs

https://www.geeksforgeeks.org/binary-search-tree-set-1-search-and-insertion/

https://www.tutorialspoint.com/data_structures_algorithms/binary_search_tree.htm

https://www.cs.usfca.edu/~galles/visualization/BST.html

https://yourbasic.org/algorithms/binary-search-tree/

https://cloud.tencent.com/developer/article/1415239

二叉搜索树 / 二叉查找树 / 二叉排序树

https://zhuanlan.zhihu.com/p/61100509


二叉搜索树 & 二叉树 & 遍历方法

xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!