![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Albert_Bolt
这个作者很懒,什么都没留下…
展开
-
二叉树
二叉树模板 结构体定义struct node{ char data;//节点为字母,若为数字就是int data; node *lc;//左儿子 node *rc;//右儿子};先序遍历//先序遍历void preorder(node *root){ if(root) { cout<<root-&gt...原创 2018-08-27 15:28:50 · 154 阅读 · 0 评论 -
杭电1710(二叉树遍历)
Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionA binary tree is a finite set of vertices that is either empty or consis...原创 2018-08-24 19:29:22 · 536 阅读 · 0 评论 -
杭电1053(哈夫曼树+字符串处理)
EntropyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionAn entropy encoder is a data encoding method that achieves lossless data compression by...原创 2018-08-24 15:59:38 · 489 阅读 · 0 评论 -
哈夫曼树
哈夫曼树模板#include <iostream>#include <cstring>#include <cstdio>#include <queue>using namespace std;priority_queue<int,vector<int>,greater<int> >q;//建立小顶堆原创 2018-08-31 11:27:08 · 285 阅读 · 0 评论 -
二叉排序树 / 二叉搜索树 / 二叉查找树
二叉排序树 / 二叉搜索树 / 二叉查找树特点中序遍历的结果必为递增序列结构体定义struct node{ int data; node *lc; node *rc;};建树//建二叉排序树 void create(node *&amp;amp;amp;amp;root,int t){ if(root==NULL) { roo...原创 2018-08-28 15:33:34 · 309 阅读 · 0 评论 -
杭电3999(数字建立二叉排序树+先序遍历)
The order of a TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description As we know,the shape of a binary search tree is greatly related to the orde...原创 2018-08-28 14:35:54 · 371 阅读 · 0 评论 -
杭电3791(数字序列建立二叉排序树+判断两树是否相同)
二叉搜索树Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description判断两序列是否为同一二叉搜索树序列Input 开始一个数n,(1<=n<=20) 表示有n个需要判断,n= 0 的时候输入结束。 接下去一行是一个序列,序列长...原创 2018-08-28 15:12:39 · 376 阅读 · 0 评论 -
POJ 1339(哈夫曼树)
poker card gameTime Limit: 1000MS Memory Limit: 10000KDescriptionSuppose you are given many poker cards. As you have already known, each card has points ranging from 1 to 13. Using these poker ...原创 2018-08-23 17:03:33 · 347 阅读 · 0 评论 -
POJ 3253(哈夫曼树)
Fence RepairTime Limit: 2000MS Memory Limit: 65536KDescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ...原创 2018-08-23 16:28:00 · 871 阅读 · 0 评论 -
POJ 1679(最小生成树+kruskal+记录边)
The Unique MSTTime Limit: 1000MS Memory Limit: 10000KDescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a conne...原创 2018-09-03 09:46:38 · 498 阅读 · 0 评论