Pregunta de entrevista de Jump Trading

Swap two variables without using a temp.

Respuestas de entrevistas

Anónimo

19 sept 2012

in c/c++: x^=y^=x^=y;

4

Anónimo

11 feb 2016

a= a*b; b = a/b; a = a/b;

2

Anónimo

24 nov 2017

+/- is correct even with overflow

Anónimo

8 nov 2012

You don't want to use +-/* as you might face under/overflow.

Anónimo

11 abr 2012

Can be done using adding/subtracting, multiply/divide, xor.