上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 34 下一页

2015年3月28日

Decode Ways

摘要: Decode Ways问题:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded... 阅读全文

posted @ 2015-03-28 20:30 zhouzhou0615 阅读(129) 评论(0) 推荐(0) 编辑

2015年3月27日

Interleaving String

摘要: Interleaving String问题:Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.思路: dfs肯定能解决 但是肯定会超时 动态规划方程dp[i][j] == true only dp[i-1][... 阅读全文

posted @ 2015-03-27 23:10 zhouzhou0615 阅读(170) 评论(0) 推荐(0) 编辑

设计模式开始--生成器模式

摘要: 生成器模式设计模式的原则:尽量暴漏在主程序里面的代码扩展性强一些,多用接口和虚拟类,少用实现类,这样再改程序的时候就方便的多了。1、作用:一个Product类的产生需要多个其他的类Unit顺序生成之后组合而成,而且这些Unit的产生方法是不固定的。举例而言一个对象会有一些重要的性质,在它们没有恰当的... 阅读全文

posted @ 2015-03-27 22:29 zhouzhou0615 阅读(191) 评论(0) 推荐(0) 编辑

Fraction to Recurring Decimal

摘要: Fraction to Recurring Decimal问题:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If t... 阅读全文

posted @ 2015-03-27 15:31 zhouzhou0615 阅读(160) 评论(0) 推荐(0) 编辑

2015年3月26日

设计模式开始--工厂模式

摘要: 工厂模式设计模式原则:业务和逻辑分离,业务主要表现在主程序中,分离之后,逻辑改变了,业务部分修改的代码要求最小,业务改变了,争取不影响逻辑部分的代码。1、作用:实例化对象,同时为了增加可扩展性,用户看到的只是接口和抽象类,接口代表的是产品,抽象类是工厂。2、类图:3、类图实现产品:(1)接口publ... 阅读全文

posted @ 2015-03-26 21:53 zhouzhou0615 阅读(132) 评论(0) 推荐(0) 编辑

设计模式开始--UML类之间关系表示

摘要: 平常写代码写的比较多,没有从架构的层次了解类与类之间的关系,下面就从代码的层面论述UML中类与类质之间的关系实线的关系要强于虚线1、extends 表示继承2、implements表示实现3、类中方法用到另外一个类作为参数表示依赖4、类中的属性中是另外一个类表示关联5、has a 的体现,类A是整体... 阅读全文

posted @ 2015-03-26 20:56 zhouzhou0615 阅读(123) 评论(0) 推荐(0) 编辑

设计模式开始1--不明觉厉

摘要: 最近的一段时间在复习设计模式~分享给大家设计模式是思考然后实现的过程,所谓思考就是定义各种各样的接口,抽象类,所谓实现,就是各种实现接口或者继承抽象类的实现类。抛开接口和抽象类resovled的时候区别,接口体现的是顺序的思考顺序,抽象类体现的是顺序+共享的思考方式,举例来说明的话,汽车的生产需要组... 阅读全文

posted @ 2015-03-26 15:04 zhouzhou0615 阅读(161) 评论(0) 推荐(0) 编辑

2015年3月23日

Gas Station

摘要: Gas Station 问题: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas 阅读全文

posted @ 2015-03-23 15:58 zhouzhou0615 阅读(143) 评论(0) 推荐(0) 编辑

2015年3月22日

Validate Binary Search Tree

摘要: Validate Binary Search Tree问题:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left sub... 阅读全文

posted @ 2015-03-22 21:04 zhouzhou0615 阅读(158) 评论(0) 推荐(0) 编辑

Word Ladder

摘要: Word Ladder问题:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one ... 阅读全文

posted @ 2015-03-22 20:39 zhouzhou0615 阅读(123) 评论(0) 推荐(0) 编辑

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 34 下一页

导航