摘要: 最短路算法的求解,都是基于下列事实:节点A到节点B的最短路径有两种可能,一种是直接从A到B,另一种是从A经过若干个节点到B。Dijkstra算法:单源最短路径问题,时间复杂度为O(n^2);不能处理权值为负的边;Floyd算法:求解图中任意节点之间的最短路径,时间复杂度为O(n^3);可以处理任意数... 阅读全文
posted @ 2015-07-27 21:20 Chapter 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longes... 阅读全文
posted @ 2015-07-27 11:04 Chapter 阅读(180) 评论(0) 推荐(0) 编辑