摘要:
1. 代理模式的定义和应用 1.1 代理模式的定义 Provide a surrogate or placeholder for another object to control access to it .(为其他对象提供一种代理以控制对这个对象的访问) 代理模式的类图如下: 代理模式也叫做委托 阅读全文
摘要:
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. Th 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. Examples: Given , the answer is , which the length is 3. Given 阅读全文
摘要:
《设计模式之禅》读书笔记(四)之抽象工厂模式 一、抽象工厂模式的定义 Provide an Interface for creating families of related or dependent objects without specifying their concrete classe 阅读全文
摘要:
工厂方法模式的定义为: Define an interface for creating an object , but let subclass decide which class to instantiate. Factory Method lets a class defer instant 阅读全文
摘要:
单例模式是一个比较简单的模式,定义如下: Ensure a class has only one instance, and provide a global point of access to it.(确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例) 1.饿汉式 2.懒汉式 线 阅读全文