JFF1: Exchanging the values of two variables

[ CiteULike link ]
Authors

João F. Ferreira

Downloads
Abstract

The problem of exchanging the values of two variables without using additional variables is very well-known. Most presentations, however, rarely highlight the properties on which the solution depends. In this short note, we investigate these properties, in order to generalize and better understand the problem.

Keywords

swapping variables, exchanging variables, XOR, algorithm, unitpotency

Bibtex entry
@article{JFF1,
    author = {Ferreira, Jo\~{a}o  F. },
    citeulike-article-id = {2448656},
    keywords = {jff-bib},
    month = {July},
    title = {Exchanging the values of two variables},
    year = {2007}
}
History
  • July 2007 — improved the note's structure
  • May 2007 — first version of the note is made public
Related