摘要: d题目链接: POJ 3253 Describe: Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N 阅读全文
posted @ 2020-08-14 19:09 不敢说的梦 阅读(121) 评论(0) 推荐(0)
摘要: 哈夫曼树: 定义: 给定N个权值作为N个叶子结点,构造一棵二叉树,若该树的带权路径长度达到最小,称这样的二叉树为最优二叉树,也称为哈夫曼树(Huffman Tree)。哈夫曼树是带权路径长度最短的树,权值较大的结点离根较近。(摘自:百度百科) 基本术语: 路径长度:从根节点到某节点通路上分支的数目, 阅读全文
posted @ 2020-08-14 13:56 不敢说的梦 阅读(490) 评论(0) 推荐(0)
摘要: 优先队列 优先队列与普通队列不同之处在于我们可以自定义元素的优先级高低,来决定谁先出队列。 基本操作与queue大致相同,底层是一个堆来实现的。 top() 返回队首元素 empty() 判空 size() 返回队列元素个数 push() 队尾插入元素(并排序) pop() 弹出队首元素 swap( 阅读全文
posted @ 2020-08-14 11:14 不敢说的梦 阅读(131) 评论(0) 推荐(0)
摘要: 题目链接: ZOJ 2724 Describe: Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If somethin 阅读全文
posted @ 2020-08-14 11:09 不敢说的梦 阅读(166) 评论(0) 推荐(0)