![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二叉查找树
Dunyb
坚毅
展开
-
二叉查找树
查找操作 void search(node *root, int x){ if(root == NULL){ printf("search failed\n"); return ; } if(x == root->data){ printf("%d\n", root->data); }else if ( x < root->data){ sea...原创 2019-02-28 18:40:28 · 129 阅读 · 0 评论 -
平衡二叉树(AVL)
初识:平衡二叉树知识点 下面就是代码了。 struct node { int v, height; //v 权值 height 当前子树高度 node *lchild, *rchild; }; node* newNode(int v){ node* Node = new node; Node->v = v; Node->height = 1; Node->...原创 2019-02-28 20:45:27 · 273 阅读 · 0 评论