Question d’entretien chez Qualcomm

Swapping integers without using additional space

Réponses aux questions d'entretien

Utilisateur anonyme

3 mai 2012

a= a(xor)b, b= a(xor)b, a=a(xor)b

7

Utilisateur anonyme

24 juill. 2012

a = a + b; b = a - b; a = a - b;

1

Utilisateur anonyme

24 juill. 2012

Doesn't work if a and b are 32 bit integer. We might have over flow in a+b. a(xor)b will not have any overflow

1