
搜索树
ddmike2015
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
AVL搜索树
AVL搜索树是二叉排序数的一个改进,在AVL中任何两个儿子子树的高度差不超过1,故查找、删除、插入在平均和最坏情况下都是O(logn)。 代码如下: #include #include #include #include #include using namespace std; typedef struct AVLTree{ int nData,nHeight; struct AVL原创 2016-07-12 20:53:50 · 519 阅读 · 0 评论 -
poj2418 Hardwood Species
题目意思:美国有很多种类的树,有硬木的,有软木的,现在输入一堆树,根据树名的字典序,从小到大输出树名及它占所有树种的比例 这题可以用很多方法解,目前只用了AVL搜索树这种方法,就是AVL搜索树的一个套用 提醒一句,貌似好多人用g++交就是错的,c++交就是对的 代码如下: #include #include #include #include #include #include using原创 2016-07-12 21:00:56 · 391 阅读 · 0 评论