Cracking The Coding Interview/Q 17.1

From Software Engineers Wiki
Jump to: navigation, search

Write a function to swap a number in place (that is, without temporary variables).

Answer

Please refer to Swap Using XOR Operations.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox