数据结构
鲸失
这个作者很懒,什么都没留下…
展开
-
二叉排序树
typedef struct Tnode{ int data; struct Tnode *lchild,*rchild;}BSTnode,*BSTree;//二叉排序树的查找算法BSTree SearchBT(BSTree root,int key,BSTree *father){ BSTree p=root; *father=NULL; whil...原创 2018-03-31 16:32:53 · 163 阅读 · 0 评论 -
数据结构之排序
#include<iostream>#include<bits/stdc++.h>using namespace std;//插入排序void InsertSort(int data[],int n){ int i,j; int temp; for(i=1;i<n;i++){ if(data[i]<data[i...原创 2018-04-01 19:32:30 · 123 阅读 · 0 评论 -
哈夫曼编码的思想(思路)
写的比较乱(哈哈),但是理解起来应该还好//哈夫曼构建#define n 50 //叶子节点个数//哈夫曼重点在于它是用数组存储结构的,也是用数组序列化(构建)的//它需要一个指明节点权值数组和节点自身字符数组的就可以了//然后通过哈夫曼规则构建有父节点和左右孩子节点的结构体数组,这就是哈夫曼//所以就没有用到链表指针typedef struct node{ char ch...原创 2018-05-17 13:56:05 · 7794 阅读 · 1 评论