本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42744709
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
思路:
(1)如果不知道anagrams的意思,很容易将题意理解错了。最开始...
分类:
其他好文 时间:
2015-01-15 20:27:31
阅读次数:
259
问题描述:
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you...
分类:
其他好文 时间:
2015-01-15 20:18:55
阅读次数:
137
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3,
30, 34, 5, 9], the largest formed number is 9534330.
Note: The result may be very...
分类:
编程语言 时间:
2015-01-15 16:13:16
阅读次数:
273
Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.思路:不...
分类:
其他好文 时间:
2015-01-15 15:57:13
阅读次数:
158
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive soluti...
分类:
其他好文 时间:
2015-01-15 13:04:35
阅读次数:
160
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recursive solut...
分类:
其他好文 时间:
2015-01-15 13:00:56
阅读次数:
141
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using ext...
分类:
其他好文 时间:
2015-01-15 11:05:40
阅读次数:
207
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without usi...
分类:
其他好文 时间:
2015-01-15 11:03:15
阅读次数:
157
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2015-01-15 09:28:07
阅读次数:
124
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using ext...
分类:
其他好文 时间:
2015-01-14 23:01:20
阅读次数:
402