DescriptionYou are to write a program that has
to decide whether a given line segment intersects a given rectangle.An
example:line: start point: (4,9)...
分类:
其他好文 时间:
2014-05-07 13:55:45
阅读次数:
387
Subsets IGiven a set of distinct integers, S,
return all possible subsets.Note:Elements in a subset must be in non-descending
order.The solution set m...
分类:
其他好文 时间:
2014-05-07 11:13:33
阅读次数:
299
这篇对应的是习题39 字典, 可爱的字典
#encoding:utf-8
#列表与字典的区别
#列表
thing = ['name',1,'age','AD','sex']
print thing[1]
#print thing['name'] #会报错,列表只能通过整数去访问:TypeError: list indices must be integers, not str
stuff...
分类:
编程语言 时间:
2014-05-07 06:00:20
阅读次数:
365
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-07 02:55:24
阅读次数:
377
题目:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
思路:
主要是深层复制的问题:
本题比较简...
分类:
其他好文 时间:
2014-05-07 02:44:38
阅读次数:
344
Unique MSTTime Limit: 3000/1000MS (Java/Others)
Memory Limit: 65535/65535KB (Java/Others)Given a connected undirected graph,
tell if its minimum span....
分类:
其他好文 时间:
2014-05-07 00:55:18
阅读次数:
530
Problem DescriptionThe expression N!, read as
"N factorial," denotes the product of the first N positive integers, where N is
nonnegative. So, for exa...
分类:
其他好文 时间:
2014-05-07 00:11:55
阅读次数:
353
You are given an N × N grid initially filled by zeros. Let the rows and columns of the grid be numbered from1 to N, inclusive. There are two types of operations can be applied to the grid:
RowAdd R...
分类:
其他好文 时间:
2014-05-06 22:35:44
阅读次数:
451
题目原文:
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,Given n = 3, there are a total of 5 unique BST's.
题目理解...
分类:
其他好文 时间:
2014-05-06 22:15:57
阅读次数:
415
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
You are given a target value to search. If found in the array retur...
分类:
其他好文 时间:
2014-05-06 19:03:11
阅读次数:
365