Set Matrix Zeroes
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Follow up:
Did you use extra space?
A s...
分类:
其他好文 时间:
2015-06-22 11:12:40
阅读次数:
113
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary ...
分类:
其他好文 时间:
2015-06-22 11:11:22
阅读次数:
99
Description:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and retur...
分类:
其他好文 时间:
2015-06-22 11:02:24
阅读次数:
104
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ 9 20
...
分类:
其他好文 时间:
2015-06-21 15:49:22
阅读次数:
131
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the f...
分类:
其他好文 时间:
2015-06-21 14:37:26
阅读次数:
145
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements...
分类:
其他好文 时间:
2015-06-21 14:33:28
阅读次数:
214
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak element and return
its index.
The array may contain multiple peaks, i...
分类:
其他好文 时间:
2015-06-21 10:43:32
阅读次数:
119
题目:
Merge k Sorted Lists
Merge
k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
分析:
用multiset作为小根堆,multiset的begin是value最小的结点。
注意:...
分类:
其他好文 时间:
2015-06-21 10:42:17
阅读次数:
127
Description:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the...
分类:
其他好文 时间:
2015-06-20 15:36:39
阅读次数:
120
Description:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to r...
分类:
其他好文 时间:
2015-06-20 15:33:52
阅读次数:
99