解:1.31 (define?(add-1?x)
??(+?x?1))
(define?(product?term?a?next?b)
??(if?(>?a?b)
??????1
??????(*?(term?a)?(product?term?(next?a)?next?b))))
(define?(prod...
分类:
其他好文 时间:
2014-08-23 15:28:31
阅读次数:
199
解题的关键在于这条路径只能是先往上走,到达某个最高点,再往下走,换句话说,只能有一次转折的机会。所以递归这棵树,记录以某个子节点为转折点时的最大值。值得注意的是树节点的值有负值,所以如果某个子路径的和小于0,放弃它(设置和为0)。
class Solution {
public:
int maxPathSum(TreeNode *root) {
int maxSum = -1 <...
分类:
其他好文 时间:
2014-08-23 10:01:00
阅读次数:
167
DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We'...
分类:
其他好文 时间:
2014-08-23 01:00:19
阅读次数:
238
OPatch failed with error code 73(OracleHomeInventory gets null oracleHomeInfo)1、问题描述[oracle@dou_rac2 oraInventory]$/u01/app/oracle/product/11.2.0/dbho...
分类:
数据库 时间:
2014-08-22 23:43:19
阅读次数:
560
有时候要写一些OC的测试代码,只关系OC的语法功能等,不需要建立app工程的,如objective-c程序设计中的例子,不需要appdelegate,则可以建立一个空的工程1. 在xcode中选file -> new ->project2. next3. 输入product name之后 next就...
分类:
其他好文 时间:
2014-08-22 16:00:59
阅读次数:
207
工厂模式和简单工厂模式差不多,只不过将每一个分支判断变成了一个子工厂类 #include?<iostream>
using?namespace?std;
class?Product?{
????public:
????????Product(){}
????????~Pr...
分类:
其他好文 时间:
2014-08-22 14:41:09
阅读次数:
214
第一步:?查看usb设备信息 在 终端输入:system_profiler SPUSBDataType???? 可以查看连接的usb设备的信息 比如我的usb信息如下(部分内容): ?Android: ????????????? Product ID: 0x2769 ?...
分类:
移动开发 时间:
2014-08-21 22:58:15
阅读次数:
978
在项目开发中,我们常常需要将工程文件打包成.ipa文件,提供给越狱的iphone安装。下面是一种方法:1、首先应该给工程安装好配置文件(这里不再敖述),在ios device的状态下,运行成功。2、选择Product->archive,如下图3、点击Distribute按钮,弹出新窗口,选择Expo...
分类:
其他好文 时间:
2014-08-21 22:37:44
阅读次数:
338
一、collection 如果设计如下页面 页面模型如下 public class Product:EZData.Context{ #region Property Name #endregion #region Property Price #endregion //按钮绑定 p...
分类:
其他好文 时间:
2014-08-20 19:16:12
阅读次数:
184
Probabilistic Latent Semantic Indexing(PLSI/PLSA)是常用的话题模型之一,他通过生成模型来模拟文档的产生过程,然后用Maximum likelihood的方法估计模型中未知参数的值,来获取整个生成模型中的参数值,从而构建起整个生成模型。...
分类:
其他好文 时间:
2014-08-20 16:32:52
阅读次数:
342