![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
AVL树
小魚兒.
天下皆白,唯我独黑!
展开
-
9.5 平衡二叉树AVL树基础算法
#include <cstdio>#include <algorithm>using namespace std;//AVL 树//1、结点struct node{ int v,height;//v为结点权值,height为当前子树高度 node *lchild,*rchild ;};//新建结点node * newnode(int v){ no...原创 2019-10-24 16:08:15 · 177 阅读 · 0 评论 -
Code Up 9.5问题 A: 算法9-9~9-12:平衡二叉树的基本操作
问题 A: 算法9-9~9-12:平衡二叉树的基本操作题目描述平衡二叉树又称AVL树,它是一种具有平衡因子的特殊二叉排序树。平衡二叉树或者是一棵空树,或者是具有以下几条性质的二叉树:1. 若它的左子树不空,则左子树上所有结点的值均小于它的根节点的值;2. 若它的右子树不空,则右子树上所有结点的值均大于它的根节点的值;3. 它的左右子树也...原创 2019-10-18 15:35:15 · 110 阅读 · 0 评论 -
PAT A1066 Root of AVL Tree (25 分)(AVL树的建立)
1066 Root of AVL Tree (25 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by...原创 2019-10-18 15:21:11 · 87 阅读 · 0 评论