上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要: 【题目】Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,... 阅读全文
posted @ 2015-04-28 10:53 hwu_harry 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 【题目】Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. Y... 阅读全文
posted @ 2015-04-27 18:01 hwu_harry 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 【题目】Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El... 阅读全文
posted @ 2015-04-27 16:15 hwu_harry 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 算法基础1.算法的几个特征 有穷性、确定性、输入、输出、可行性2.算法的复杂性定义3.递归算法的定义、递归算法的两要素 定义:一种直接或者间接调用自己的算法 两要素: ①终止条件 ②每次调用的时候,范围会缩小4.分治算法的思想,经典的分治算法(全排列、二分搜索、归并排序、快速排序、... 阅读全文
posted @ 2015-04-23 09:32 hwu_harry 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 一.KMP算法简介 Knuth-Morris-Pratt 字符串查找算法,简称为 “KMP算法”,常用于在一个文本串S内查找一个模式串P 的出现位置,这个算法由Donald Knuth、Vaughan Pratt、James H. Morris三人于1977年联合发表,故取这3人的姓氏命名此算法。... 阅读全文
posted @ 2015-04-22 15:10 hwu_harry 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页