
A家
benbenab
这个作者很懒,什么都没留下…
展开
-
OOD之思路乱发散
每一个object都含有state和method,因此定义一个object的时候一定要说明他的含有什么data member,还有什么method。 多用design pattern,少用inheritance;using interfaces 1. 设计一个文本编辑器 a)composite pattern来分别管理只读文本和可读写文本 b)singl原创 2012-12-17 11:37:25 · 521 阅读 · 0 评论 -
edit distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a w原创 2012-12-20 03:43:20 · 383 阅读 · 0 评论 -
expression 5+4*(7-15) or have parenthesis in any order // 波兰表示法
Answers write code in java /c for expression 5+4*(7-15) or have parenthesis in any order . idea: Use two stack, one for number, one for operator. Every time push a number or an operation into stack.原创 2012-12-16 22:53:57 · 505 阅读 · 0 评论