Category Archives: Tricks

The Art of Swapping Variables

Swapping variables is probably one of the most common operations inside computer programs. But did you know that there are many ways to perform a swamp? Below I’ll talk about some of them. Using an Extra Variable The easiest way is to use an extra temporary variable (usually called “temp”) where you store the value […]