Tag Archives: algorithm

Swap Two Numbers Without Temporary Variable

If you want to swap two variables, you would normally require a temporary third variable. But how to swap them without using a third variable? This is quite often a popular interview question for programming jobs.

Java Singleton Design Pattern

The Singleton Pattern is one of the most commonly used design patterns in Java. This design pattern is used to restrict the instantiation of a class to a single object.