problem:
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 endpoints of line i is at (i, ai) and (i, 0)...
分类:
其他好文 时间:
2015-03-18 15:53:14
阅读次数:
110
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:
其他好文 时间:
2015-03-18 01:08:26
阅读次数:
196
problem:
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of conv...
分类:
其他好文 时间:
2015-03-17 22:00:59
阅读次数:
163
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-03-17 14:00:52
阅读次数:
108
题目链接:Minimum Path Sum
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 ei...
分类:
其他好文 时间:
2015-03-15 23:44:17
阅读次数:
329
题目链接:Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
这道题的要求是向右旋转链表...
分类:
其他好文 时间:
2015-03-15 23:43:32
阅读次数:
353
Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.[Solu...
分类:
其他好文 时间:
2015-03-15 18:21:30
阅读次数:
114
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...
分类:
其他好文 时间:
2015-03-15 07:06:35
阅读次数:
100
Integer.MIN_VALUE自不必说,就是32位整型能存储的最小数字:0x80000000,是一个负数。
但是Double.MIN_VALUE却是一个正数:
可以看到,Double.MIN_VALUE表示的时64位双精度值能表示的最小正数。如果需要用到Double的负无穷,可以用Double.NEGATIVE_INFINITY...
分类:
其他好文 时间:
2015-03-14 18:37:46
阅读次数:
118
一、设计思想: 1、 为了实现题目中的要求,可以将各个功能由方法来实现,首先设计加减法运算方法。 2、加法方法:jiaFa(int range/*数值范围*/,int negative_OK/*0表示无负数,1表示可有负数*/,int fraction/*0表示无分数,1表示真分数,2表示支持假.....
分类:
其他好文 时间:
2015-03-14 18:26:36
阅读次数:
355