We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果树中的每一个节点最多只能由两个子节点,这样的树就称为二叉树;
空的二叉树、只有一个节点的二叉树、只有左子树 TL 的二叉树、只有右子树 TR 的二叉树和有左右两个子树的二叉树。
完美二叉树(Perfect Binary Tree)也成为满二叉树(Full Binary Tree),在二叉树中,除了最下一层的叶子节点外,每层节点都有 2 个子节点,这就构成了完美二叉树。
完全二叉树(Complete Binary Tree):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
二叉树
二叉树的概念
如果树中的每一个节点最多只能由两个子节点,这样的树就称为二叉树;
二叉树的组成
二叉树的五种形态
空的二叉树、只有一个节点的二叉树、只有左子树 TL 的二叉树、只有右子树 TR 的二叉树和有左右两个子树的二叉树。
二叉树的特性
0表示叶子节点的个数,n2表示度为 2 的非叶子节点个数,那么两者满足关系:n0= n2+ 1;如下图所示:H,E,I,J,G 为叶子节点,总数为 5;A,B,C,F 为度为 2 的非叶子节点,总数为 4;满足 n0= n2+ 1 的规律。特殊的二叉树
完美二叉树
完美二叉树(Perfect Binary Tree)也成为满二叉树(Full Binary Tree),在二叉树中,除了最下一层的叶子节点外,每层节点都有 2 个子节点,这就构成了完美二叉树。
完全二叉树
完全二叉树(Complete Binary Tree):
The text was updated successfully, but these errors were encountered: