[leetcode]Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0....
分类:
其他好文 时间:
2014-10-10 15:07:44
阅读次数:
167
Problem:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a...
分类:
其他好文 时间:
2014-10-10 01:32:53
阅读次数:
213
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-10-09 17:15:15
阅读次数:
218
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine i...
分类:
其他好文 时间:
2014-10-09 16:59:57
阅读次数:
203
此题不难,可以用dfs来做,也可以用动态规划,但明显dfs性能不如dp。
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:...
分类:
编程语言 时间:
2014-10-09 15:59:48
阅读次数:
163
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...
分类:
其他好文 时间:
2014-10-09 13:16:43
阅读次数:
179
这道题真真是在面试中碰到过,可惜当时复杂度到O(n2)了,太挫了,怪不得没有通过面试。
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two en...
分类:
编程语言 时间:
2014-10-09 01:58:17
阅读次数:
229
Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki...
分类:
其他好文 时间:
2014-10-07 19:09:53
阅读次数:
180
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-10-06 21:14:50
阅读次数:
220
//Given a non-negative number represented as an array of digits, plus one to the number.
//The digits are stored such that the most significant digit is at the head of the list.
//digits={9,9,9,...
分类:
其他好文 时间:
2014-10-06 13:46:10
阅读次数:
200