Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially...
分类:
其他好文 时间:
2015-01-05 01:50:06
阅读次数:
218
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 ...
分类:
其他好文 时间:
2015-01-04 21:32:18
阅读次数:
145
QUESTIONGiven 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 t...
分类:
其他好文 时间:
2015-01-03 11:48:00
阅读次数:
146
Longest Palindromic Substring
Question
Solution
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists...
分类:
其他好文 时间:
2015-01-03 00:57:31
阅读次数:
272
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:
其他好文 时间:
2015-01-03 00:53:53
阅读次数:
235
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42342251
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the version stri...
分类:
其他好文 时间:
2015-01-02 17:33:55
阅读次数:
275
https://oj.leetcode.com/problems/palindrome-number/http://fisherlei.blogspot.com/2012/12/leetcode-palindrome-number.htmlpublicclassSolution{
publicbooleanisPalindrome(intx){
//Assume
//Negativenumberscannotbepalindrome
if(x<0)
returnfalse;
//Noextrasp..
分类:
其他好文 时间:
2015-01-02 16:14:01
阅读次数:
116
Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
class Solution {
private:
TreeNode *root;
v...
分类:
其他好文 时间:
2015-01-02 09:46:36
阅读次数:
107
dseg segment source_data dw ?,-1,3,6,1,5 count equ $-source_datadseg endscseg segment assume cs:cseg , ds:dsegstart: ...
分类:
编程语言 时间:
2015-01-01 14:49:05
阅读次数:
204
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:
其他好文 时间:
2014-12-30 21:54:37
阅读次数:
183