- 博客(6)
- 收藏
- 关注
原创 leetcode:273. Integer to English Words
Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example,123 -> "One Hundred Twenty Three"12345 -> "Twelve Thousand Th
2016-02-22 22:35:31 265
原创 leetcode: 172. 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!质因数分解中,2的次幂一定大于5的次幂,所以0的个数取决于5的次幂有多少代码class Solution {
2016-02-19 14:06:37 188
原创 leetcode:152. Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the la
2016-02-19 03:11:12 216
原创 leetcode:226. Invert Binary Tree
很简单的一道题,递归就行了/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL
2016-02-17 01:06:08 301
原创 leetcode:104. Maximum Depth of Binary Tree
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 farthest leaf node.Subscribe to see which compani
2016-02-17 00:21:41 210
原创 《剑指offer》 学习笔记(二): 二维数组中的查找
面试题3:二维数组中的查找题目描述:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。输入:输入可能包含多个测试样例,对于每个测试案例,输入的第一行为两个整数m和n(1输入的第二行包括一个整数t(1接下来的m行,每行有n个数,代表题目所给出的m行n
2016-02-14 22:45:29 303
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人