
C++ 二叉树 搜索树
呆为
这个作者很懒,什么都没留下…
展开
-
一个搜索二叉树的类
#include using namespace std; class BinarySearchTree; class BinaryNode { public : int element; BinaryNode *leftChild; BinaryNode *rightChild; BinaryNode(int theElement,BinaryNo转载 2017-05-14 12:57:25 · 193 阅读 · 0 评论 -
搜索二叉树
BinarySearchTree类,只是一个操作类,提供操作函数,不提供存储。 #include <iostream> #include<cstdlib> #include<ctime> using namespace std; class BinarySearchTree; class BinaryNode { public : int element; BinaryNode *l原创 2017-05-16 17:36:26 · 183 阅读 · 0 评论 -
AVL树
//修改自《算法之美》,更易理解(自认为) #include using namespace std; template class AvlTree; template class AvlNode { T data; //关键码 AvlNode *leftChild; AvlNode *rightChild; int balance;//平衡因子 public: AvlN转载 2017-05-29 21:26:59 · 150 阅读 · 0 评论 -
TridTree
参考了人家的代码,还是写转载吧。#include #include #define num_chars 26 //只能插入英文字母 using namespace std; class Trid_node { private: char* words; int n; Trid_node* branch[num_chars]; public: Trid_node() { wor转载 2017-06-13 15:27:37 · 240 阅读 · 0 评论