laimanyou

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2015年6月6日

摘要: 最近在学习设计模式,参考《大话设计模式》这一经典书籍,为了加深自己理解,在这比划比划!1.策略模式(Strategy):它定义了算法家族,分别封装起来,让它们之间可以互相替换,此模式让算法的变化,不会影响到使用算法的客户。描述:1)定义一个算法的抽象基类,包含一个公共方法(C++中的纯虚函数); ... 阅读全文
posted @ 2015-06-06 11:24 laimanyou 阅读(94) 评论(0) 推荐(0)

2015年5月18日

摘要: 1.Two sumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of t... 阅读全文
posted @ 2015-05-18 23:41 laimanyou 阅读(140) 评论(0) 推荐(0)