![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 52
duyiwuer2009
这个作者很懒,什么都没留下…
展开
-
【队列】poj 3125
/* * poj 3125 * http://poj.org/problem?id=3125 * 【队列】此题不适用用 STL 做,反而会是操作麻烦 * 思路:找到第一个优先级最高的任务处理掉,其前面的任务插入队尾。 * 1. 为了节省空间,实际操作不移动最大优先级任务之前的任务,而是将 * 头指针指向后面一个任务,队列循环使用。 * 2. 已经处理掉的任务优先级设为 0 *原创 2014-04-08 18:26:40 · 1339 阅读 · 0 评论 -
STL中map,multimap,set,multiset,unordered_map,unordered_multimap,unordered_set,unordered_multiset的实现方法
1. set, multiset, map, multimap, unordered_map原创 2014-04-15 19:30:12 · 2585 阅读 · 0 评论 -
【并查集】POJ-1611
/* POJ-1611 并查集(基础题)①带路径压缩的查找②合并:先判断是否在同一集合,合并操作执行的条件是2元素不在同一集合*/#include #define N 30001int set[N];int elemNum[N];void initialize(int n);int findSet(int a);void unionSet(int a, int b); in原创 2012-02-25 15:36:05 · 560 阅读 · 0 评论 -
diff 实现算法
diffhttp://en.wikipedia.org/wiki/DiffLongest common subsequence problemhttp://en.wikipedia.org/wiki/Longest_common_subsequence_problemDiff Strategieshttps://neil.fraser.name/writing/原创 2013-08-28 20:01:10 · 5034 阅读 · 0 评论 -
背包问题
背包问题九讲,http://love-oriented.com/pack/前言目录第一讲 01背包问题第二讲 完全背包问题第三讲 多重背包问题第四讲 混合三种背包问题第五讲 二维费用的背包问题第六讲 分组的背包问题第七讲 有依赖的背包问题第八讲 泛化物品第九讲 背包问题问法的变化附录一:USACO中的背包问题附录二:背包问题的搜索解法联系方式致谢转载 2012-07-01 19:53:00 · 987 阅读 · 0 评论 -
常用算法英文名
-----排序算法——sort algorithm插入排序——insertion sort折半插入排序——binary insertion sort, http://xlinux.nist.gov/dads/HTML/binaryinsort.html希尔排序——shell sort选择排序——selection sort堆排序——heap sort归并排序(或合并排序原创 2012-04-09 19:38:47 · 5608 阅读 · 0 评论 -
[附图]Kruskal算法和Prim算法
Kruskal算法和Prim算法转自:http://www.comp.nus.edu.sg/~xujia/mirror/algorithm.myrice.com/algorithm/commonalg/graph/mst/chapter2.htm本节所阐述的两种最小生成树算法是上节所介绍的一般算法的细化。每个算法均采用一特定规则来确定GENERIC-MST算法第3行所描述的安全边;转载 2012-02-25 10:38:08 · 1553 阅读 · 0 评论 -
很不错的几篇关于算法的文章
一些重要的算法:http://coolshell.cn/articles/2583.html一个显示排序过程的Python脚本(带Python源码):http://coolshell.cn/articles/536.htmlThe Archive of Interesting Code(一位斯坦福大学的讲师写的算法源码):http://www.keithschwarz.com/inte原创 2011-12-22 23:31:04 · 711 阅读 · 0 评论 -
数据结构算法演示
旧金山大学:http://www.cs.usfca.edu/~galles/visualization/Algorithms.html太原理工大学:http://www.tyut.edu.cn/kecheng1/site01/suanfayanshi/default.asp一篇推荐博文:《可视化的数据结构与算法》http://coolshell.cn/articles/4671原创 2011-12-22 22:00:42 · 765 阅读 · 0 评论 -
【栈】【双端队列】【stack】【deque】hdu 4286
http://acm.hdu.edu.cn/showproblem.php?pid=4286sh原创 2014-04-07 22:05:31 · 999 阅读 · 0 评论