![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构UT
Kibbo
前端不行,后端不通,拥有HHKB但不用Vim的男人。
喜欢键盘,沉溺于域名的世界,剁手多次。
展开
-
二叉树的建立和先中后顺序遍历
二叉树的建立二叉树建立问题 个人观点 二叉树是一对多的关系,所以在存储结构中借助链表节点进行动态存储。首先建立节点,递归进行建立。 typedef char ElemType; typedef struct node { ElemType data; struct node *lchild; struct node *rchild; }*BiTree, BiNode原创 2017-11-02 18:17:42 · 368 阅读 · 0 评论 -
先中序建二叉树
先中序or中后序建立二叉树二叉树的顺序 二叉树的顺序(先左后右的顺序,相反顺序相反) 先(根)序遍历 中(根)序遍历 后(根)序遍历 可以根据中序和先序/后序建立二叉树,但是必须要有中序,因为只有这样可以划分左右子树,递归的完成序列的访问。先序和中序建立二叉树#include <stdio.h> #include <string.h> #include <stdlib.h> typedef cha原创 2017-11-04 22:00:21 · 238 阅读 · 0 评论 -
哈弗曼编码
哈弗曼编码 涉及哈弗曼树的建立 代码解决为,不断进行排序,选择最小的放在最前边,然后相加建立。#include <stdio.h> #include <string.h> #include <stdlib.h> char str[2560]; int book[2560]; int tap[2560]; int cmp(const void *a, const void *b) { retu原创 2017-11-04 22:03:34 · 136 阅读 · 0 评论