/** * Definition for binary tree * struct
TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :
val(x), left(...
分类:
其他好文 时间:
2014-07-22 23:07:34
阅读次数:
312
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-07-22 23:07:13
阅读次数:
379
在表单中输入数据提交时提示invalid field value for
field"product.sale
Date".(product.sale是文本框的名字,Date是其数据类型)原因:输入数据的格式错误。希望:将提示改为,如:“格式错误,请输入正确的格式”。方法:使用国际资源,PS:国际资...
分类:
其他好文 时间:
2014-05-01 20:09:45
阅读次数:
281
题目: Given a string S, find the longest palindromic
substring in S. You may assume that the maximum length of S is 1000, and there
exists one unique lo...
分类:
其他好文 时间:
2014-05-01 20:07:13
阅读次数:
429
以下是代码及解析,其中有底色的部分为脚本内容。注释、!define、变量、!include、常量; Script generated by the HM NIS
Edit Script Wizard.; HM NIS Edit Wizard helper defines!define PRODUCT...
分类:
其他好文 时间:
2014-05-01 14:37:24
阅读次数:
534
这道题需要注意的地方有以下一些:1.
求从子树中的某节点到当前节点的最大路径不能采用递归方法,因为这个部分会被反复的调用,如果用递归,会使得之前已经计算过的节点被重复计算,使得时间复杂度特别高;2.
树中有节点的值是负数的。下面是AC代码。(我发现AC并不代表代码真的完全正确!!) 1 /** 2 ...
分类:
其他好文 时间:
2014-05-01 12:10:52
阅读次数:
274
概述
将一个具体类的实例化交给一个静态工厂方法来执行,它不属于GOF的23种设计模式,但现实中却经常会用到角色 工厂类(Simple Factory):
只包含了创建具体类的静态方法。 抽象产品(Product):定义简单工厂中要返回的产品。 具体产品(ConcreteProduct):具体...
分类:
其他好文 时间:
2014-05-01 12:02:59
阅读次数:
392
概述 提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类.让子类决定实例化哪一个类角色
抽象工厂(Creator):这个抽象类(或接口)声明一个创建对象的工厂方法,用来返回一个Product类型的对象。
具体工厂(ConcreteCreator):重定义工厂方法,返回一个具体的...
分类:
其他好文 时间:
2014-05-01 11:22:38
阅读次数:
366
MaximumTime Limit:3000MSMemory Limit:0KB64bit IO
Format:%lld & %lluSubmitStatusDescriptionLetx1,x2,...,xmbe real numbers
satisfying the following cond...
分类:
其他好文 时间:
2014-05-01 01:13:54
阅读次数:
415
《深入理解Android内核设计思想》已陆续在全国各大书店上市,电子书店也在陆续上架中(不断增加):1. http://product.china-pub.com/3803721书本目录和一些章节内容将陆续与各位亲爱的读者们分享,感谢大家一直以来的支持和鼓励~~...
分类:
移动开发 时间:
2014-04-28 10:11:42
阅读次数:
359