上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction ... Read More
posted @ 2014-07-25 20:48 Xylophone Views(211) Comments(0) Diggs(0)
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po... Read More
posted @ 2014-07-25 10:41 Xylophone Views(138) Comments(0) Diggs(0)
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up: Could you do this in-place?注意知识点:容器特有的泛型算... Read More
posted @ 2014-07-25 09:08 Xylophone Views(103) Comments(0) Diggs(0)
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((... Read More
posted @ 2014-07-25 08:21 Xylophone Views(113) Comments(0) Diggs(0)
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,... Read More
posted @ 2014-07-24 11:13 Xylophone Views(131) Comments(0) Diggs(0)
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb... Read More
posted @ 2014-07-24 10:00 Xylophone Views(131) Comments(0) Diggs(0)
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 / \ ... Read More
posted @ 2014-07-24 08:58 Xylophone Views(129) Comments(0) Diggs(0)
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... Read More
posted @ 2014-07-24 08:27 Xylophone Views(140) Comments(0) Diggs(0)
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.解题方法-----1.回溯法要解决N皇后问题,其实就是... Read More
posted @ 2014-07-24 06:39 Xylophone Views(231) Comments(0) Diggs(0)
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.string intToS(int cur,string s,int base,map ... Read More
posted @ 2014-07-22 08:45 Xylophone Views(170) Comments(0) Diggs(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页