判断相交的情况比较复杂,所以从判断不相交的角度考虑。! (P1.y P4.x || P2.y > P3.y || P2.x < P3.x)
分类:
其他好文 时间:
2014-12-18 00:01:52
阅读次数:
241
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-12-17 14:44:41
阅读次数:
191
// Exercise 2.3 Calculating volume price of alternative products// The only problem here is to devise a way to determine the price// for the product ....
分类:
其他好文 时间:
2014-12-16 22:34:36
阅读次数:
263
问题描述:
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the tot...
分类:
其他好文 时间:
2014-12-15 10:30:25
阅读次数:
196
Given two strings S and T, determine if they are both one edit distance apart.Analysis:Must be exactly one distance apart. Not the same.Solution: 1 pu...
分类:
其他好文 时间:
2014-12-15 06:31:20
阅读次数:
149
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41910495
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
思路:
(1)题意为给定一个(每个节点带有数值)二叉...
分类:
其他好文 时间:
2014-12-13 18:04:21
阅读次数:
176
[root@Oraclehttpd-2.2.27]#/etc/init.d/httpdstarthttpd:Couldnotreliablydeterminetheserver‘sfullyqualifieddomainname,using127.0.0.1forServerName解决措施:[root@Oraclehttpd-2.2.27]#vim/usr/local/apache2/conf/httpd.confServerNamelocalhost:80
分类:
Web程序 时间:
2014-12-12 16:57:07
阅读次数:
135
一、JQuery
如果是用JQuery的话,可以用inArray()函数:
jquery inarray()函数详解
jquery.inarray(value,array)
确定第一个参数在数组中的位置(如果没有找到则返回 -1 )。
determine the index of the first parameter in the array (-1 if not found)....
分类:
编程语言 时间:
2014-12-12 16:45:41
阅读次数:
155
题意: 给四个点,判断四边形的形状。可能是正方形,矩形,菱形,平行四边形,梯形或普通四边形。解法: 开始还在纠结怎么将四个点按序排好,如果直接处理的话,有点麻烦,原来凸包就可搞,直接求个凸包,然后点就自动按逆时针排好了,然后就判断就可以了,判断依据题目下面有,主要是用到点积和叉积,判断垂直用点积,判...
分类:
其他好文 时间:
2014-12-11 23:59:44
阅读次数:
446
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题思路:突发奇想,脑洞大开。回路,自然是走到已经走过的地方,如何知道这个地方已经走...
分类:
其他好文 时间:
2014-12-11 23:48:27
阅读次数:
147