上一页 1 ··· 11 12 13 14 15
摘要: 1.排序桶排序● 冒泡排序● 快速排序● 栈、队列、链表● 枚举● 数的全排列● 万能的搜索● 广度优先搜索● 图的遍历● 深度和广度优先究竟是指啥● 图的深度优先遍历● 图的广度优先遍历 最短路径● 只有五行的算法——Floyd-Warshall● Dijkstra算法... 阅读全文
posted @ 2016-03-11 17:02 Code-dream 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 迪杰斯特拉 看啊哈算法中迪杰斯特拉算法体会; 算法思路 ;1.先找到源头到其他点的最短路;2.以最短路作为中转点进行比较,用一个dis数组保存源头到他的最优距离3.用循环进行最优筛选;#includeint e[1005][1005],dis[1005],book[1005],i,j,n,m,... 阅读全文
posted @ 2016-03-11 11:13 Code-dream 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 核心代码for(int k=1; kdistmap[i][k]+distmap[k][j])//不满足三角不等式 { distmap[i][j]=distmap[i][k]+distmap[k][j];//更新 pat... 阅读全文
posted @ 2016-03-09 21:15 Code-dream 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: 点击打开题目链接 本题目是考察 最长递增子序列的 有n^2 n(logn) n^2 会超时的下面两个方法的代码 思路 可以百度LIS LCSdp里面存子序列n(logn) 代码#include#include#include#include#include#define ... 阅读全文
posted @ 2016-03-05 20:50 Code-dream 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题目链接 点击打开链接 Pots Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Submit Status Description You are given two pots, having the 阅读全文
posted @ 2016-03-05 19:17 Code-dream 阅读(232) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15