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 ...
分类:
编程语言 时间:
2015-01-13 06:42:51
阅读次数:
201
LeetCode172——Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
难度系数:容易
题目大意:给定一个整数n,...
分类:
其他好文 时间:
2015-01-13 01:27:55
阅读次数:
142
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf...
分类:
其他好文 时间:
2015-01-12 22:25:47
阅读次数:
451
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 from ...
分类:
编程语言 时间:
2015-01-12 21:01:06
阅读次数:
280
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-12 16:31:05
阅读次数:
180
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf...
分类:
其他好文 时间:
2015-01-12 14:25:06
阅读次数:
126
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2015-01-12 13:03:03
阅读次数:
136
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
先将原字符串数组中的字符串单独排序,如:bac-->abc,然后对整个的数组排序,此时数组中相邻的字符串如果相等,则原数组中的两字符串必满足条件,将其加入到结...
分类:
其他好文 时间:
2015-01-12 11:37:18
阅读次数:
200
1.C++ I/O各类之间的继承关系图参考网址: http://www.cplusplus.com/reference/iolibrary/Note: 在程序中包含iostream文件将自动创建8个流对象(4个用于窄字符流, 4个用于宽字符流),如下:cin --标准输入流,该流被关联到标准输...
分类:
编程语言 时间:
2015-01-11 22:54:47
阅读次数:
285
Multiply StringsGiven two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large ...
分类:
其他好文 时间:
2015-01-11 21:35:00
阅读次数:
219