上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 98 下一页
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2014-11-21 20:25 Jessica程序猿 阅读(154) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2014-11-21 19:39 Jessica程序猿 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-11-21 18:47 Jessica程序猿 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Dynamic ProgrammingSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most ... 阅读全文
posted @ 2014-11-21 17:39 Jessica程序猿 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 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 le... 阅读全文
posted @ 2014-11-21 17:05 Jessica程序猿 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2014-11-21 15:33 Jessica程序猿 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2014-11-21 13:41 Jessica程序猿 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-11-21 10:45 Jessica程序猿 阅读(216) 评论(0) 推荐(0) 编辑
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?C++实现代码:#include#in... 阅读全文
posted @ 2014-11-21 10:05 Jessica程序猿 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).C++实现代码:#includeusing namespace std;class Solution{public: double pow(double x, int n) { if(x==0&&n==0) ret... 阅读全文
posted @ 2014-11-21 09:16 Jessica程序猿 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 98 下一页