Standard swap

Source: Wikipedia, the free encyclopedia.

In computer science, the standard swap or three point turn[

variables
.

By using a third variable, whose value is otherwise of no concern, to hold the value of the first, and then assigning the second's to the first, and the third's back to the second, the values of the first two are swapped.

For example:

  1. let temp = b
  2. let b = a
  3. let a = temp

In modern[

RAM
.