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-01-16 13:13:25
阅读次数:
154
(http://leetcode.com/2010/11/convert-binary-search-tree-bst-to.html)Convert a BST to a sorted circular doubly-linked list in-place. Think of the left ...
分类:
其他好文 时间:
2015-01-16 08:42:31
阅读次数:
156
Follow up for "Find Minimum in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Suppose a sorted array is rotated at some pivot u...
分类:
其他好文 时间:
2015-01-15 22:14:10
阅读次数:
166
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-15 22:13:10
阅读次数:
176
题目:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The functi...
分类:
其他好文 时间:
2015-01-15 21:51:33
阅读次数:
159
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Hide TagsDepth-first SearchLinked List 这....
分类:
其他好文 时间:
2015-01-15 21:47:04
阅读次数:
171
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.为了方便表头处理,...
分类:
其他好文 时间:
2015-01-14 17:54:36
阅读次数:
242
题目
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 ...
分类:
其他好文 时间:
2015-01-14 16:54:36
阅读次数:
183
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* ...
分类:
其他好文 时间:
2015-01-14 15:35:32
阅读次数:
178
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *nex...
分类:
其他好文 时间:
2015-01-14 15:33:27
阅读次数:
169