算法竞赛时候写下的一些常用算法的C++模板,仅供参考
内容包括:
-
排序:选择排序,插入排序,冒泡排序,桶排序
-
搜索:DFS,BFS,A*
-
数据结构:二叉树,哈希表(拉链法),堆(以及堆排序),并查集,栈,线性表,队列,循环队列
-
高精度算法:加,减,乘,除,朴素除法
-
分治:快速排序,二分答案,归并排序
-
图论:多元最短路径ASSP(Floyd),单源最短路径SSSP(Dijkstra+Heap, SPFA),最小生成树(Kruskal, Prim+Heap),最近公共祖先LCA,拓扑排序,强连通分量,割点,割边,二分图最大匹配
-
STL模板的使用:heap, queue, priority_queue, sort, stack, vector