随笔分类 -  data_structure

算法
摘要:1,数组最大,https://blog.csdn.net/robert_chen1988/article/details/78032743 2,数组的一些操作,https://www.w3cschool.cn/java/java-array2.html 3,字符串反转 http://www.runo 阅读全文

posted @ 2018-08-14 23:37 Kooing 阅读(107) 评论(0) 推荐(0)

排序
摘要: 阅读全文

posted @ 2018-08-13 14:47 Kooing 阅读(108) 评论(0) 推荐(0)

hash
摘要:1,设散列表的长度为8,散列函数H(k)=k mod 7,初始记录关键字序列为(32,24,15,27,20,13),计算用链地址法作为解决冲突方法的平均查找长度是( ) 链地址法作为解决冲突 方法:将所有关键字为同义词的记录存储在一个单链表中,并用一维数组存放头指针。 0 1 2 3 4 5 6 阅读全文

posted @ 2018-08-12 21:04 Kooing 阅读(275) 评论(0) 推荐(0)

摘要:1,完全,每个点都有直接的连,n个定点和无向图n(n-1)/2,有向图n(n-1) 2,回路或环:回到开始的点,简单的回路或环:除了第一个,其他不重复 3,连通图,连通分量:任意两点都可以连通的,连通分量:子图的任意两点是连通的 4,深度遍历:辅助空间visit[i],表示有没有访问过,时间复杂度, 阅读全文

posted @ 2018-08-12 21:04 Kooing 阅读(162) 评论(0) 推荐(0)

摘要:0,n个结点的书,深度为k,2的k-1次方 =< n =< 2的k次方-1,k=log2n上界+11,一个完全二叉树节点数为200,则其叶子结点个数为? 两个知识点:n0+n1+n2=2n2+n1+1 n0=n2+1 因为是完全二叉树,所以n1=1或者0,这里总结点是200,因为公式2n2+n1+1 阅读全文

posted @ 2018-06-06 22:10 Kooing 阅读(148) 评论(0) 推荐(0)

AVL树相关操作
摘要:#include using namespace std; //AVL树的节点 template class TreeNode { public: TreeNode() :lson(NULL), rson(NULL), freq(1), hgt(0){} T data;//值 int hgt;//以这个结点为根的树的高度 int freq;//相同点的频率,... 阅读全文

posted @ 2016-06-28 20:09 Kooing 阅读(166) 评论(0) 推荐(0)

哈夫曼树
摘要:#include #include #include #include using namespace std; typedef struct Tree { int weight; int parent, lchild, rchild; }Tree, *HuffmanTree; void Select(HuffmanTree HT, int i, int &s1,... 阅读全文

posted @ 2016-05-17 21:07 Kooing 阅读(159) 评论(0) 推荐(0)

线索化二叉树的相关操作
摘要:#include using namespace std; typedef struct Tree { char data; int lTag, rTag; struct Tree *lchild, *rchild; }Tree; void firstCreateTree(Tree* &T) { char ch; cin >> ch; if... 阅读全文

posted @ 2016-05-17 18:07 Kooing 阅读(244) 评论(0) 推荐(0)

二叉树的基本操作
摘要:#include using namespace std; typedef struct Tree { char data1; struct Tree *lchild, *rchild; }Tree; template struct Node { T data; Node* next; }; template class stack { Node... 阅读全文

posted @ 2016-05-16 22:09 Kooing 阅读(150) 评论(0) 推荐(0)

我的模板栈
摘要:1 template 2 struct Node 3 { 4 T data; 5 Node* next; 6 }; 7 8 template 9 class stack 10 { 11 Node* top; 12 public: 13 stack():top(NULL){} 14 void push(T n); 15 T pop... 阅读全文

posted @ 2016-05-16 19:31 Kooing 阅读(122) 评论(0) 推荐(0)

导航