#include <iostream>
#include "AVLTree.h"
#include "algorithm_bt.h"
using namespace std;
void main()
{
cout<<"\t\tAVL Tree\n";
cout<<"This is a project showing the AVL Tree(balanced binary search tree):"<<endl;
int array[]={1,2,3,4,5,6,7,8,9,10};
int len=sizeof(array)/sizeof(int);
AVLTree<int> tree;
for(int i=0;i<len;i++)
tree.Insert(array[i]);
BTDisplay(tree.Root());
AVLTree<int>::Iterator ir;
cout<<"\nremove the number 9,.....\n";
ir=tree.find(9);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 8,.....\n";
ir=tree.find(8);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 6,.....\n";
ir=tree.find(6);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 4,.....\n";
ir=tree.find(4);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 1,.....\n";
ir=tree.find(1);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 2,.....\n";
ir=tree.find(2);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\nremove the number 3,.....\n";
ir=tree.find(3);
tree.erase(ir);
BTDisplay(tree.Root());
cout<<"\n\n\t\tEND"<<endl;
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Tree.rar (84个子文件)
Tree
BinaryTree
main.cpp 894B
BinaryTree.hpp 2KB
BinaryTree.opt 49KB
BinaryTree.ncb 65KB
BinaryTree.dsw 545B
BinaryTree.dsp 4KB
BTNode.h 691B
BinaryTree.plg 1KB
BinaryTree.h 975B
algorithm_bt.h 5KB
TreeIterator
main.cpp 711B
TreeIterator.opt 49KB
TreeIterator.ncb 41KB
TreeIterator.plg 1KB
BinaryTree.hpp 2KB
TreeIterator.dsw 549B
TreeIterator.h 837B
BTNode.h 691B
BinaryTree.h 975B
InIterator.h 2KB
PreIterator.h 2KB
algorithm_bt.h 6KB
TreeIterator.dsp 4KB
Heap
algorithm_heap.h 2KB
main.cpp 615B
Heap.dsp 4KB
Heap.opt 48KB
Heap.ncb 41KB
Heap.dsw 533B
Heap.plg 1KB
BinarySearchTree
main.cpp 1KB
BinarySearchTree.opt 48KB
BSTree.hpp 2KB
BinarySearchTree.ncb 49KB
BinarySearchTree.dsp 4KB
BinaryTree.hpp 2KB
BSTree.h 1KB
BinarySearchTree.dsw 557B
BSTNode.h 709B
BinarySearchTree.plg 266B
BTNode.h 691B
BinaryTree.h 975B
algorithm_bt.h 6KB
Huffman
algorithm_heap.h 2KB
main.cpp 668B
BinaryTree.hpp 2KB
Huffman.dsw 539B
Huffman.opt 48KB
BTNode.h 691B
Huffman.h 2KB
BinaryTree.h 975B
PriorityQueue.h 812B
Huffman.plg 1KB
algorithm_bt.h 6KB
Huffman.ncb 49KB
Huffman.dsp 4KB
AVLTree
main.cpp 1KB
BSTree.hpp 2KB
AVLTree.opt 50KB
BinaryTree.hpp 2KB
BSTree.h 1KB
BSTNode.h 709B
AVLTree.hpp 5KB
BTNode.h 691B
BinaryTree.h 975B
algorithm_bt.h 6KB
AVLTree.ncb 49KB
AVLTree.h 1KB
AVLTree.dsw 539B
AVLTree.plg 248B
AVLTree.dsp 4KB
ThreadedBinaryTree
main.cpp 626B
BinaryTree.hpp 2KB
ITIterator.h 1KB
ThreadedBinaryTree.dsp 4KB
ThreadedBinaryTree.dsw 561B
TreeIterator.h 837B
ThreadedBinaryTree.plg 1KB
ThreadedBinaryTree.ncb 49KB
BinaryTree.h 975B
algorithm_bt.h 6KB
ITBTree.h 2KB
ThreadedBinaryTree.opt 48KB
TBTNode.h 739B
共 84 条
- 1
资源评论
- wulijingsai2011-11-11不错的源码哈,而且有主函数进行测试!
- pawpaw_guang2012-03-24不错的源码哈,而且有主函数进行测试!
- 路小小卡2014-03-03特别适合参考,推荐
- abcdnml2013-09-27确实是很好的例子 学了不用老是忘 不记得的时候看下 蛮有用的
xinxipan
- 粉丝: 29
- 资源: 34
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功