搜索
nicaishibiantai
这个作者很懒,什么都没留下…
展开
-
Lintcode - Search in 2D matrix II
Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.This matrix has the following properties: * Integers in each row are sorted from left原创 2015-01-30 14:50:06 · 1838 阅读 · 0 评论 -
Find Peak Element
A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, i原创 2015-04-08 13:28:53 · 445 阅读 · 0 评论 -
Lintcode - Segment Tree Query
For an integer array (index from 0 to n-1, where n is the size of this array), in the corresponding SegmentTree, each node stores an extra attributemax to denote the maximum number in the interval o原创 2015-05-03 07:17:19 · 1637 阅读 · 0 评论 -
Minimum size subarray sum
iven an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3,原创 2015-05-18 06:15:08 · 912 阅读 · 0 评论