题目:
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from...
分类:
其他好文 时间:
2015-03-13 12:44:23
阅读次数:
139
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 array is non-empty and the majority element always exist in the array....
分类:
其他好文 时间:
2015-03-13 00:26:46
阅读次数:
204
1.题目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 array is non-empty and the majority element al...
分类:
其他好文 时间:
2015-03-12 20:53:53
阅读次数:
109
题目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 array is non-empty and the majority element alwa...
分类:
其他好文 时间:
2015-03-12 11:31:13
阅读次数:
132
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 have exactly...
分类:
其他好文 时间:
2015-03-12 00:59:44
阅读次数:
113
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...
分类:
其他好文 时间:
2015-03-11 23:30:19
阅读次数:
242
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-11 21:29:40
阅读次数:
112
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
98 Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree o...
分类:
其他好文 时间:
2015-03-11 14:58:29
阅读次数:
122
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-10 21:27:41
阅读次数:
134
Sudoku Solver问题:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that ...
分类:
其他好文 时间:
2015-03-10 16:47:03
阅读次数:
110