题目描述Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longes...
分类:
其他好文 时间:
2015-06-11 12:36:10
阅读次数:
110
Maximum Subarray IIIGiven an array of integers and a numberk, find knon-overlappingsubarrays which have the largest sum.The number in each subarray sh...
分类:
其他好文 时间:
2015-06-10 19:19:20
阅读次数:
170
1. 概述
RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j当然,该问题也可以用线段树(也叫区间树)解决,算法复杂度为:O(N)~O(logN),这里我们暂不介绍。
2.RMQ算法
对于该问题,最容易想到的解决方案是遍历,复杂度是O(n)。但当数据量非常大...
分类:
编程语言 时间:
2015-06-10 17:25:58
阅读次数:
173
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2015-06-10 12:03:48
阅读次数:
88
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2015-06-10 07:42:10
阅读次数:
99
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-06-10 06:33:56
阅读次数:
99
原文:http://blog.chunshengster.me/2013/12/mobile_tcp_stack_optimizing.htmlhttp://blog.chunshengster.me/2013/12/optimizing_your_linux_stack_for_maximum_m...
分类:
其他好文 时间:
2015-06-09 13:37:30
阅读次数:
157
No.164 Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear ti...
分类:
其他好文 时间:
2015-06-08 19:01:57
阅读次数:
80
Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those who...
分类:
其他好文 时间:
2015-06-08 17:32:11
阅读次数:
118
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 [4,?1,2,1] has the...
分类:
其他好文 时间:
2015-06-08 11:44:36
阅读次数:
114