【题目】
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relati...
分类:
其他好文 时间:
2014-06-29 07:27:17
阅读次数:
210
Effective c++ 之 继承关系与面向对象设计 提到了在一堆classes中去辨别关系的准则,面向对象设计中容易产生的问题...
分类:
编程语言 时间:
2014-06-20 13:01:06
阅读次数:
274
条款27:尽量少做转型动作
C++的四种显示类型转换...
分类:
其他好文 时间:
2014-06-20 09:16:32
阅读次数:
195
如果说类实现了封装,那么三层又将相关的类进行了封装,把它们封装在三个类库中。因为类的存在,减少了类与类之间的耦合;因为三层的存在,减少了职责不同的类之间的耦合。 所以三层的目的和面向对象的思想是一致的,就是要实现高内聚,低耦合,便于代码的更改,复用,即提高代码的灵活性,可维护性,复用性。还有一点很重要,就是安全。 我想看这篇文章的人至少对三层有一点点了解。一定知道三层包括:UI...
分类:
其他好文 时间:
2014-06-07 14:51:18
阅读次数:
150
【题目】
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be...
分类:
其他好文 时间:
2014-06-07 14:28:36
阅读次数:
215
【题目】
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
1
2
3
4
\...
分类:
其他好文 时间:
2014-06-07 11:37:00
阅读次数:
153
前言题目有点大,其实也就是手痒。。。跟大家来扯一下javascript编译过程。那么到底什么是“编译”呢这个。。。本人文笔太差,我还是直接举例子吧。相信玩过js童鞋应该都看过下面这样一个面试题:
var a=3; function fn(){ ...
分类:
编程语言 时间:
2014-06-07 09:28:42
阅读次数:
325
PHP5.0后,php面向对象提成更多方法,使得php更加的强大!!
一些在PHP叫魔术方法的函数,在这里介绍一下:其实在一般的应用中,我们都需要用到他们!!1.__construct()
当实例化一个对象的时候,这个对象的这个方法首先被调用。 Java代码 class Test { functio...
分类:
Web程序 时间:
2014-06-07 06:12:00
阅读次数:
195
前言 好记性不如烂“笔头”系列——大话设计模式学习笔记
目录面向对象基础面向对象基础什么是类与实例
一切事物皆为对象,即所有的东西老师对象,对象就是可以看到、感觉到、听到、触摸到、尝到、或闻到的东西。准确地说,对象是一个自包含的实体,用一组可识别的特性和行为来标识。面向对象编程,英文叫
Obj...
分类:
其他好文 时间:
2014-06-05 13:31:13
阅读次数:
263