树
Timplan
这个作者很懒,什么都没留下…
展开
-
二叉搜索树
struct treenode { elementtype element; tree left; tree right; }; typedef struct treenode bintree; bintree Delete(elementtype x,bintree bst) { position tmp; if(!bst) pri...原创 2018-10-31 22:45:59 · 130 阅读 · 0 评论 -
树 先序 中序 推出后序遍历
//prel:先序遍历数组开始元素下标位置 //inl:中序遍历数组开始元素下标位置 //postl:后序遍历数组开始元素下标位置 void solve(int prel ,int inl ,int postl ,int n) { if(n == 0) //如果要判断的数组中元素个数为0 则退出 { return ; } ...原创 2018-10-24 22:08:20 · 182 阅读 · 0 评论 -
哈夫曼树
哈夫曼树 struct treenode { int weight; struct treenode *left, *right; }; struct treenode *huffman(minheap h) { //假设h->size个权值已经存在h->elements[]->weight里 int i; struct treenode...原创 2018-10-24 22:47:05 · 159 阅读 · 0 评论