02 2016 档案
摘要:作者:Hawstein出处:http://hawstein.com/posts/dp-novice-to-advanced.html 前言 本文翻译自TopCoder上的一篇文章: Dynamic Programming: From novice to advanced ,并非严格逐字逐句翻译,其中加入了自己的一些理解。水平有限,还望指摘。 前言_ 我们遇到的问题中,有很大一部分可以用动态规划(简...
阅读全文
摘要:Maximum Subarray: 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,2,1,−5,4],the contiguous subarray [...
阅读全文
摘要:Majority Element II:Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 题意:找出给定数组中出现次数多于数组长度三分之一的元素 思路:根...
阅读全文
摘要:Word Search:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell,
阅读全文

浙公网安备 33010602011771号