摘要:
单例模式,是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例的特殊类。通过单例模式可以保证系统中,应用该模式的类一个类只有一个实例。即一个类只有一个对象实例。 这就是单例模式的描述,在接下来我们将详细讲讲单例模式在Java语言中的具体实现。首先我们先介绍双重锁检测机制。 public c 阅读全文
摘要:
/*3Sum 描述 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0 ? Find all unique triplets in the array which gives 阅读全文
摘要:
/*Remove Element 描述 Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be ch 阅读全文