西安交通大学计算机系 林荣彬
第2版声明 .......................................................................................................................................
第2版序言 ........................................................................................................................................
阅读方法 .........................................................................................................................................
通用头文件 general_head.h .............................................................................................................
1.排序 Sort ....................................................................................................................................
(1)插入排序 insert_sort.cpp ...............................................................................................
(2)冒泡排序 bubble_sort.cpp ...........................................................................................
(3)快速排序 quick_sort.cpp ...............................................................................................
(4)二分查找法 binary_search.cpp ......................................................................................
(5)测试用例 test.cpp ..........................................................................................................
2.搜索 Search .........................................................................................................................
(0)搜索头文件 search.h .....................................................................................................
(1)暴力枚举 brute_force.cpp ..............................................................................................
(2)深度优先搜索 depth_first_search.cpp ............................................................................
(3)广度优先搜索 breadth_first_search.cpp ........................................................................
(4)双向广度搜索 bidirection_breadth_search.cpp .............................................................
(5)A*启发式搜索 a_heuristic_search.cpp ...........................................................................
(6)高级搜索算法介绍 advanced_search_algorithm_introduction.cpp .................................
(7)测试用例 test.cpp ..........................................................................................................
3.数据结构 Data Structure ................................................................................................................
(0)数据结构头文件 data_structure.h .................................................................................
(1)经典数据结构介绍 classic_data_structure_introduction.cpp ...........................................
(2)哈希表 hash_table.cpp ...................................................................................................
(3)线段树 segment_tree.cpp ...............................................................................................
(4)树状数组 binary_index_tree.cpp .....................................................................................
(5)并查集 disjoint_set.cpp ...................................................................................................
(6)左偏树 leftist_tree.cpp ....................................................................................................
(7)后缀树 suffix_tree.cpp ....................................................................................................
(8)测试用例 test.cpp ............................................................................................................
4.动态规划 Dynamic Programming ....................................................................................................
(1)动态规划介绍 dynamic_programming_introduction.cpp ...................................................
(2)动态规划优化 dynamic_programming_optimization.cpp ....................................................
4.1线性动态规划 Linear Dynamic ................................................................................................
(1)最长公共子序列 longest_common_subsequence.cpp ......................................................
(2)最长递增子序列 longest_increasing_subsequence.cpp ...................................................
(3)最长递增子序列扩展 longest_increasing_subsequence_extension.cpp ...........................
(4)双向子序列 bidirection_subsequence.cpp .......................................................................
(5)测试用例 test.cpp ............................................................................................................
4.2背包问题 Pack ...............................................................................................................
(0)背包头文件 pack.h ...................................................................................................
(1)01背包 _01_pack.cpp ..............................................................................................
(2)01背包路径 _01_pack_path.cpp ................................................................................
(3)完全背包 complete_pack.cpp ..................................................................................
(4)多重背包 multiple_pack.cpp ....................................................................................
(5)二维背包 two_dimension_pack.cpp .........................................................................
(6)分组背包 packet_pack.cpp .......................................................................................
(7)泛化物品 generic_item.cpp ..............................................................................................
(8)依赖背包 dependent_pack.cpp .................................................................................
(9)测试用例 test.cpp .............................................................................................................
4.3区域动态规划 Region Dynamic .............................................................................................
(1)最小合并代价 minimum_merge_cost.cpp .......................................................................
(2)最小合并扩展 minimum_merge_extension.cpp .....................................................................
(3)最大二叉树合并 maximum_binary_tree_merge.cpp .........................................................
(4)测试用例 test.cpp ............................................................................................................
4.4树形动态规划 Tree Dynamic ..................................................................................................
(0)树形动规头文件 tree_dynamic.h ......................................................................................
(1)二叉树动规 binary_tree.cpp ............................................................................................
(2)多叉树动规 multi_tree.cpp ..............................................................................................
(3)多叉树转二叉树动规 multi2binary.cpp .............................................................................
(4)多叉树动规路径 multi_tree_path.cpp ..............................................................................
(5)带环多叉树动规 loop_tree.cpp ........................................................................................
(6)遍历树 traverse_tree.cpp ...............................................................................................
(7)测试用例 test.cpp ...........................................................................................................
5.图论 Graph Theory ........................................................................................................................
(0)图论头文件 graph.h .........................................................................................................
5.1遍历 Traverse .......................................................................................................................
(1)遍历树 traverse_tree.cpp .................................................................................................
(2)深度优先搜索邻接表 depth_first_search_adjlist.cpp ........................................................
(3)广度优先搜索邻接表 breadth_first_search_adjlist.cpp .....................................................
(4)拓扑排序 topological_sort.cpp .........................................................................................
(5)欧拉回路 euler_loop.cpp ..................................................................................................
(6)汉密尔顿回路 hamilton_loop.cpp ......................................................................................
(7)Kosaraju算法 kosaraju.cpp ..............................................................................................
(8)2-SAT问题 _2_satisfiability.cpp .........................................................................................
(9)测试用例 test.cpp ..............................................................................................................
5.2Tarjan算法 Tarjan ...................................................................................................................
(1)强连通分支 strongest_connected_component.cpp ...........................................................
(2)Gabow算法 gabow.cpp .....................................................................................................
(3)割 cut.cpp .........................................................................................................................
(4)双连通分支 double_connected_component.cpp ...............................................................
(5)最近公共祖先 least_common_ancestors.cpp ...................................................................
(6)区间最值查询 range_most_query.cpp ...............................................................................
(7)测试用例 test.cpp ............................................................................................................
5.3最小生成树 Minimum Spanning Tree .....................................................................................
(1)Kruskal算法 kruskal.cpp ....................................................................................................
(2)Prim算法 prim.cpp .............................................................................................................
(3)次小生成树 second_minimum_spanning_tree.cpp .............................................................
(4)度限制生成树 degree_bounded_spanning_tree.cpp .........................................................
(5)最优比率生成树 optimal_ratio_spanning_tree.cpp ............................................................
(6)测试用例 test.cpp ...............................................................................................................
5.4最短路径 Shortest Path ...........................................................................................................
(1)松弛操作 relaxation.cpp .....................................................................................................
(2)Bellman-Ford算法 bellman_ford.cpp .................................................................................
(3)最短路径更快算法 spfa.cpp ...............................................................................................
(4)Dijkstra算法 dijkstra.cpp ....................................................................................................
(5)Floyd算法 floyd.cpp ..........................................................................................................
(6)差分约束 difference_constraints.cpp .................................................................................
(7)测试用例 test.cpp ..............................................................................................................
5.5流网络 Flow Network ...............................................................................................................
(1)Edmonds-Karp算法 edmonds_karp.cpp ............................................................................
(2)一般性压入与重标记 generic_push_relabel.cpp ................................................................
(3)Dinic算法 dinic.cpp .............................................................................................................
(4)距离标号算法 distance_label.cpp .......................................................................................
(5)重标记与前移算法 relabel_to_front.cpp .............................................................................
(6)最高标号预留与推进算法 highest_label_preflow_push.cpp ..............................................
(7)距离标号算法邻接表优化 distance_label_list.cpp ..............................................................
(8)最大流算法小结 summary_of_maxflow_algorithm.cpp ......................................................
(9)最小费用最大流 minimum_cost_max_flow.cpp .................................................................
(10)多源点多汇点最大流 multi_source_sink_max_flow.cpp .....................................................
(11)连通度 connectiviry.cpp ..............................................................................................
(12)无源汇容量有上下界的流网络 no_source_sink_bounded_flow.cpp ...................................
(13)有源汇容量有上下界的最大流 bounded_max_flow.cpp ...................................................
(14)有源汇容量有上下界的最小流 bounded_min_flow.cpp .....................................................
(15)测试用例 test.cpp .........................................................................................................
(16)附录1 POJ_1087_A_Plug_for_UNIX1.cpp ......................................................................
(17)附录2 POJ_1087_A_Plug_for_UNIX2.cpp ......................................................................
5.6二分匹配 Binary Match ........................................................................................................
(1)匈牙利算法 hungarian.cpp ..............................................................................................
(2)Hopcroft-Karp算法 hopcroft_karp.cpp ............................................................................
(3)二分匹配转最大流 match2maxflow.cpp ............................................................................
(4)Kuhn-Munkres算法 kuhn_munkres.cpp ..........................................................................
(5)支配集,独立集,覆盖集与团介绍 domination_independent_covering_clique_introduction.cpp...
(6)最小点权覆盖和最大点权独立集 weighted_covering_independent_set.cpp .............................
(7)最小不相交路径覆盖 minimum_disjoint_path_covering.cpp ................................................
(8)最小可相交路径覆盖 minimum_joint_path_covering.cpp ....................................................
(9)染色问题 coloring.cpp ...................................................................................................
(10)测试用例 test.cpp .............................................................................................................
6.线性代数 Linear Algebra ...................................................................................................................
(0)矩阵头文件 matrix.h .........................................................................................................
6.1矩阵 Matrix ..............................................................................................................................
(1)Strassen算法 strassen.cpp ................................................................................................
(2)高斯消元法 gauss_elimination.cpp .....................................................................................
(3)LUP分解 lup.cpp ................................................................................................................
(4)逆矩阵 inverse_matrix.cpp .................................................................................................
(5)测试用例 test.cpp ..............................................................................................................
6.2线性规划 Linear Programming .............................................................................................
(1)单纯形算法 simplex.cpp ..................................................................................................
(2)Dinkelback算法 dinkelback.cpp ......................................................................................
(3)测试用例 test.cpp ..............................................................................................................
7.数学 Math .........................................................................................................................................
7.1计算 Calculate .......................................................................................................................
(1)大数字 large.hpp ..............................................................................................................
(2)十进制转换 decimal_conversion.cpp ................................................................................
(3)求幂运算 exponentiation.cpp ............................................................................................
(4)测试用例 test.cpp .............................................................................................................
7.2组合数学 Combinatorial Mathematics ....................................................................................
(1)组合数学介绍 combinatorial_mathematics_introduction.cpp ............................................
(2)全排列 full_permutation.cpp .............................................................................................
(3)组合 combination.cpp .......................................................................................................
(4)置换群 permutation_group.cpp ........................................................................................
(5)测试用例 test.cpp ............................................................................................................
7.3数论 Number Theory .............................................................................................................
(1)筛选法 sieve.cpp ..............................................................................................................
(2)Euclid算法 euclid.cpp ........................................................................................................
(3)Euclid扩展 euclid_extension.cpp .......................................................................................
(4)模线性方程 modular_linear_equation.cpp ........................................................................
(5)中国剩余定理 chinese_remainer_theorem.cpp ...............................................................
(6)模幂运算 modular_exponentiation.cpp ............................................................................
(7)测试用例 test.cpp ...........................................................................................................
8.解析几何 Analytic Geometry ...........................................................................................................
(0)几何头文件 geometry.h ...................................................................................................
8.1向量 Vector ..........................................................................................................................
(1)叉积 cross.cpp .......................................................................................................
(2)线段相交 segments_intersection.cpp ..............................................................................
(3)扫除算法 sweeping.cpp ......................................................................................................
(4)测试用例 test.cpp ............................................................................................................
8.2多边形 Polygon ..................................................................................................................
(1)多边形面积 polygon_area.cpp .........................................................................................
(2)多边形重心 polygon_gravity_center.cpp ..........................................................................
(3)射线判别法 ray.cpp ..........................................................................................................
(4)旋转卡壳 rotating_calipers.cpp ........................................................................................
(5)测试用例 test.cpp ............................................................................................................
8.3凸包 Convex Hull ................................................................................................................
(1)最近点对 nearest_neighbor.cpp .....................................................................................
(2)Graham扫描算法 graham_scan.cpp ..............................................................................
(3)快速凸包算法 quick_convex_hull.cpp .................................................................................
(4)测试用例 test.cpp ..........................................................................................................
9.字符串匹配 String ..........................................................................................................................
(1)原始字符串匹配 naive_string_match.cpp ........................................................................
(2)KMP算法 knuth_morris_pratt.cpp ...................................................................................
(3)字典树 trie_tree.hpp .......................................................................................................
(4)AC自动机 aho_corasick_automation.hpp .......................................................................
(5)测试用例 test.cpp ............................................................................................................
10.博弈论 Game Theory .....................................................................................................................
(1)巴什博弈 bash_game.cpp ..............................................................................................
(2)威佐夫博弈 wythoff_game.cpp .......................................................................................
(3)尼姆博弈 nim_game.cpp ...............................................................................................
(4)SG函数 sprague_grundy.cpp ..........................................................................................
(5)测试用例 test.cpp ............................................................................................................