04 2020 档案

摘要:出栈序列的合法性判断如果栈无限大:出栈序列中的每个数后面的比它小的数,是按递减排列的。 如果栈大小有限制:模拟基础实验3-2.4 出栈序列的合法性 (25point(s))代码:#include using na... 阅读全文
posted @ 2020-04-30 13:30 月光下の魔术师 阅读(34) 评论(0) 推荐(0)
摘要:PTA基础实验4-2.4 搜索树判断 (25point(s))题意给出一棵树的前序遍历或者镜像的前序遍历,判断是否是二叉树,如果是,输出后序遍历。题解如果是一棵二叉树,那么通过前序+中序可以构建,中序升序排列。 ... 阅读全文
posted @ 2020-04-27 13:21 月光下の魔术师 阅读(30) 评论(0) 推荐(0)
摘要:PTA哈夫曼编码题意:给定每个单词出现的频率,给出一套编码,判断是否满足哈夫曼编码。题解:通过单词出现的频率计算wpl。可以通过c++的stl优先队列快速处理。 然后计算编码的wpl是否满足,以及是否存在编码前缀... 阅读全文
posted @ 2020-04-26 17:18 月光下の魔术师 阅读(31) 评论(0) 推荐(0)
摘要:#include using namespace std;int const N = 1000 + 10;typedef struct BST{ struct BST *left,*right; in... 阅读全文
posted @ 2020-04-25 11:30 月光下の魔术师 阅读(6) 评论(0) 推荐(0)
摘要:插入排序#include #include #include using namespace std;int const N = 10 + 5;int main(){ int n = 10; int ... 阅读全文
posted @ 2020-04-23 19:58 月光下の魔术师 阅读(10) 评论(0) 推荐(0)
摘要:相关知识点最小点覆盖 = 最大匹配。 最大独立集 = 所有顶点数 - 最小顶点覆盖 最大团 = 补图的最大独立集 最小路径覆盖 = |G|-最大匹配最大匹配算法匈牙利算法bool dfs(int u){ f... 阅读全文
posted @ 2020-04-23 14:56 月光下の魔术师 阅读(12) 评论(0) 推荐(0)
摘要:HDU2089题解代码(无前导0)#include using namespace std;typedef long long ll;int const N = 10;int n,m,dp[N][N],a[N];... 阅读全文
posted @ 2020-04-17 23:09 月光下の魔术师 阅读(4) 评论(0) 推荐(0)