2010年5月21日

Longest common subsequence problem

摘要: http://en.wikipedia.org/wiki/Longest_common_subsequence_problemLCS function defined Let two sequences be defined as follows: X = (x1, x2...xm) and Y = (y1, y2...yn). The prefixes of X are X1, 2,...m; ... 阅读全文

posted @ 2010-05-21 20:42 cutepig 阅读(522) 评论(0) 推荐(0) 编辑

活用regex的例子 zz

摘要: 在reddit推荐的文章上看到的。下面的代码在CMD窗口下运行通过。如果在BASH下面运行,单引号和双引号要对调。 perl-wle"print'prime'if(1xshift)!~/^1?$|^(11+?)\1+$/"<任意一个数> Python的代码是: importredefis_prime(num):returnnotre.match(r"^1?$|^(11+?)\1+... 阅读全文

posted @ 2010-05-21 19:50 cutepig 阅读(235) 评论(0) 推荐(0) 编辑

最全的design pattern 概述

摘要: http://en.wikipedia.org/wiki/Software_design_patternClassification and list Design patterns were originally grouped into the categories: creational patterns, structural patterns, and behavioral patter... 阅读全文

posted @ 2010-05-21 08:35 cutepig 阅读(672) 评论(0) 推荐(0) 编辑

导航