![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索树
ddmike2015
这个作者很懒,什么都没留下…
展开
-
AVL搜索树
AVL搜索树是二叉排序数的一个改进,在AVL中任何两个儿子子树的高度差不超过1,故查找、删除、插入在平均和最坏情况下都是O(logn)。代码如下:#include#include#include#include#includeusing namespace std;typedef struct AVLTree{ int nData,nHeight; struct AVL原创 2016-07-12 20:53:50 · 466 阅读 · 0 评论 -
poj2418 Hardwood Species
题目意思:美国有很多种类的树,有硬木的,有软木的,现在输入一堆树,根据树名的字典序,从小到大输出树名及它占所有树种的比例这题可以用很多方法解,目前只用了AVL搜索树这种方法,就是AVL搜索树的一个套用提醒一句,貌似好多人用g++交就是错的,c++交就是对的代码如下:#include#include#include#include#include#includeusing原创 2016-07-12 21:00:56 · 344 阅读 · 0 评论