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 attribute m ...
分类:
其他好文 时间:
2016-04-05 19:14:24
阅读次数:
191
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise). Example Given a matrix [ [1,2], [3,4] ] rotate it b ...
分类:
其他好文 时间:
2016-04-05 12:36:18
阅读次数:
141
Given a roman numeral, convert it to an integer. The answer is guaranteed to be within the range from 1 to 3999. Example IV -> 4 XII -> 12 XXI -> 21 X ...
分类:
其他好文 时间:
2016-04-05 12:27:59
阅读次数:
138
Reverse a linked list from position m to n. Notice Given m, n satisfy the following condition: 1 ≤ m ≤ n ≤ length of list. Given m, n satisfy the foll ...
分类:
其他好文 时间:
2016-04-05 07:08:50
阅读次数:
136
Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example Given "25525511135", return [ "255. ...
分类:
其他好文 时间:
2016-04-05 07:07:57
阅读次数:
144
Given a singly linked list L: L0 → L1 → … → Ln-1 → Ln reorder it to: L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → … Example Given 1->2->3->4->null, reorder it to ...
分类:
其他好文 时间:
2016-04-05 07:05:10
阅读次数:
160
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example Given 1->2->3- ...
分类:
其他好文 时间:
2016-04-04 17:53:23
阅读次数:
216
The size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size >= capacity / 10), we should do ...
分类:
其他好文 时间:
2016-04-04 17:47:32
阅读次数:
175
Given a list of numbers with duplicate number in it. Find all unique permutations. Example For numbers [1,2,2] the unique permutations are: [ [1,2,2], ...
分类:
其他好文 时间:
2016-04-04 16:19:47
阅读次数:
100
Given a list of integers, which denote a permutation. Find the previous permutation in ascending order. Notice The list may contains duplicate integer ...
分类:
其他好文 时间:
2016-04-04 16:15:46
阅读次数:
112