旧游无处不堪寻
无寻处,惟有少年心
LeetCode-Longest Substring Without Repeating Characters
题目 Given a string, find the length of the longest substring without repeating...
2022-03-11
LeetCode-Add Two Numbers
题目 You are given two non-empty linked lists representing two non-negative int...
2022-03-10
LeetCode-Two Sum
题目 Given an array of integers, return indices of the two numbers such that th...
2022-03-09
设计模式-访问者
访问者模式(Visitor Pattern)是一种行为型设计模式,它能将算法与其所作用的对象隔离开来。 解释 访问者模式建议将新行为放入一个名为访问者的独...
2022-03-07
设计模式-模板方法
模板方法模式(Template Method Pattern)是一种行为型设计模式,它在超类中定义了一个算法的框架,允许子类在不修改结构的情况下重写算法的...
2022-03-06
设计模式-策略
策略模式(Strategy Pattern)是一种行为型设计模式,它能让你定义一系列算法,并将每种算法分别放入独立的类中,以使算法的对象能够相互替换。 解...
2022-03-05
设计模式-状态
状态模式(State Pattern)是一种行为型设计模式,让你能在一个对象的内部状态变化时改变其行为,使其看上去就像改变了自身所属的类一样。 解释 状态...
2022-03-04
设计模式-观察者
观察者模式(Observer Pattern)是一种行为型设计模式,允许你定义一种订阅机制,可在对象事件发生时通知多个”观察”该对象的其他对象。 解释 拥...
2022-03-03
设计模式-备忘录
备忘录模式(Memento Pattern)是一种行为型设计模式,允许在不暴露对象实现细节的情况下保存和恢复对象之前的状态。 解释 备忘录模式将创建状态快...
2022-03-02
设计模式-中介者
中介者模式(Mediator Pattern)是一种行为型设计模式,能让你减少对象之间混乱无序的依赖关系。该模式会限制对象之间的直接交互,迫使它们通过一个...
2022-03-01