算法
shayue111
这个作者很懒,什么都没留下…
展开
-
manacher's algorithm寻找最长回文子串
manacher’s algorithm寻找最长回文子串 #include <vector> #include <iostream> #include <string> using namespace std; string Manacher(string s) { // Insert '#' string t = "$#&q转载 2018-10-18 21:51:50 · 111 阅读 · 0 评论 -
Dijkstra算法
应用 Dijkstra算法能得到某一个点到其他点的最短路径。 介绍 输入数据: 6 6 1 4 1 1 2 2 1 6 4 2 5 5 4 3 2 2 6 1 算法简介 有两个集合,S1-已经确定最短路径的点,S2-候选点 每一轮while循环会从S2中挑出距离x最近的一个点作为real_x加入S1,并利用real_x来更新其他点到x的路径 步骤演练 以x = 1 为例,表格中蓝色表示已经加入S...原创 2018-11-20 11:38:16 · 129 阅读 · 0 评论