题目链接:majority-element
/**
*
Given an array of size n, find the majority element.
The majority element is the element that appears more than ? n/2 ? times.
You may assume that the arra...
分类:
编程语言 时间:
2015-03-19 14:50:38
阅读次数:
112
problem:
Given an array S of n integers, find three integers in S such that the sum is closest to a
given number, target. Return the sum of the three integers. You may assume that each input
would ...
分类:
其他好文 时间:
2015-03-19 10:12:45
阅读次数:
114
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
E...
分类:
其他好文 时间:
2015-03-18 20:33:09
阅读次数:
191
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Example 1...
分类:
其他好文 时间:
2015-03-18 14:07:17
阅读次数:
139
Recursive method can be unstand easily:1. Assume we get the sub node with this transition. So we need to make the current node.2. As the symmetic, the...
分类:
其他好文 时间:
2015-03-18 10:12:06
阅读次数:
128
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
...
分类:
其他好文 时间:
2015-03-17 21:55:20
阅读次数:
110
Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the arr...
分类:
其他好文 时间:
2015-03-15 21:12:26
阅读次数:
169
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp...
分类:
其他好文 时间:
2015-03-14 23:12:09
阅读次数:
217
A quick and easy way for Mac OS X?10.8 and 10.9: I assume you have XCode, it‘s command line tool, Python and MySQL installed. Install PIP: sudo easy_install pip Edit ~/.profile: nano ~/.profile C...
分类:
数据库 时间:
2015-03-14 15:32:44
阅读次数:
184
1.题目Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in the array....
分类:
其他好文 时间:
2015-03-13 20:45:47
阅读次数:
96