tree
Nova0820
der
展开
-
Trie (字典树) 的基本操作---插入,删除,单词前缀匹配等等
#include<iostream>#include<vector>#include<algorithm>#include<cctype>using namespace std;const int R = 26;typedef struct TrieTree* Position;enum Color{red,black};struct TrieTree { char ch; Color color;//red表示一个单词到此处结束,原创 2020-06-20 12:21:34 · 941 阅读 · 0 评论 -
AVL树(平衡二叉树)的构建及其基本的插入操作
#include<iostream>#include<algorithm>#include<cctype>#include<fstream>#include<cstring>using namespace std;struct AVLTree { int data; struct AVLTree* left; struct AVLTree* right; int height;};//构建AVL树的基本原创 2020-06-05 21:19:41 · 321 阅读 · 0 评论 -
最大堆(MaxHeap)的基本操作(建立,插入和删除)
#include<iostream>#include<vector>#include<algorithm>#include<map>#include<fstream>#include<cctype>using namespace std;const int INF = 0x3f3f3f;typedef struct Max_Heap { int* element; int capacity; int size;}原创 2020-05-26 19:21:18 · 1187 阅读 · 2 评论 -
二叉排序树的基本骚操作
二叉排序树的基本操作#include<bits/stdc++.h>using namespace std;struct BiTree{ int data; struct BiTree *lchild,*rchild;};typedef BiTree* node;node search(int T,node root)//二叉排序树的搜索{ nod...原创 2020-05-08 11:47:16 · 127 阅读 · 1 评论