判断一个字符串是不是回文,忽略其中的非数字和非字母,例如符号和空格不考虑。For example,"A man, a plan, a canal: Panama"is a palindrome."race a car"isnota palindrome.Note:Have you consider ...
分类:
其他好文 时间:
2014-12-04 00:53:19
阅读次数:
227
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a ...
分类:
其他好文 时间:
2014-12-03 23:34:37
阅读次数:
396
There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[...
分类:
其他好文 时间:
2014-12-03 14:01:14
阅读次数:
142
2.2.2层次性结构计算叶节点(leaves tree) = (leaves (car tree)) + (leaves (cdr tree)),(leaves leave) = 1;; 计算tree中叶节点数量(define (leaves tree) (cond ((null? tree) 0....
分类:
其他好文 时间:
2014-12-03 13:57:09
阅读次数:
187
CD
You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so the problem to solve is: you have a tape N m...
分类:
其他好文 时间:
2014-12-01 22:32:19
阅读次数:
228
class Car{ int num; String color; void run() { System.out.println(num+"..."+color); }}new Car().num = 5;匿名对象:没有名字的对象new Car(...
分类:
其他好文 时间:
2014-12-01 00:42:21
阅读次数:
229
这是一篇关于回顾设计模式SOLID五大原则的文章,我非常喜欢文章中的例子,每个例子都是我精选了描述模式的,通过Modom讲述了单一职责原则、通过加减法计算器讲述了开闭原则、通过企鹅动物讲述了里氏替换原则、通过Driver和Car实现了依赖倒置原则,最后讲述了接口隔离原则.希望文章对大家有所帮助,尤其是学习设计模式的同学和代码写得不太规范或重构的同学,如果有错误或不足之处,还请海涵~...
分类:
其他好文 时间:
2014-11-29 21:45:19
阅读次数:
287
表单序列化
Male
Female
My bike.
My car.
Volvo
Benz
BMW
Audi
zhangsan
lisi
wangwu
zhaoliu
function serialize(form){
var parts=[],
...
分类:
编程语言 时间:
2014-11-29 16:01:54
阅读次数:
150
Cocoa 提供了一个名为NSPredicate的类,用于指定过滤器的条件,用NSPredicate描述查询方式,原理类似于在数据库中进行查询。可以在数据库风格的API中使用NSPredicate类,常见的用于Core Data和Spotlight。 本文讲解过程中用到了部分类比如garage(车库的类),car(车)等仅供举例,未列出创建代码,体会predicate的用法才是关键。
创...
分类:
其他好文 时间:
2014-11-27 20:33:11
阅读次数:
198
在上一篇博文中,我们有拿一个简单的“汽车模型”来讲解复合关系。在今天的这篇博文中,我们将接着上一次的例子,讲解下存取(accessor)方法的使用。所谓存取方法,就是用来读取或改变某个对象属性的方法。如果添加一个方法去改变Car对象中的engine对象变量,那它就是一个存取方法。 存取方法分为...
分类:
其他好文 时间:
2014-11-27 00:07:40
阅读次数:
284