Question d’entretien chez Microsoft

find duplicates in an array with space efficiency

Réponses aux questions d'entretien

Utilisateur anonyme

28 oct. 2016

Assuming that for every array element we have: 1. a .equals() type of method/function (for checking duplicates) 2. a .compare() type of method/function (for sorting) Since you are striving for space efficiency and not speed, maybe what you could do is sort the array using a good sorting technique (that does not cost too much space to perform) and then run through array checking for adjacent duplicates (as sorting will put duplicates next to one another)..

1

Utilisateur anonyme

18 nov. 2016

When did they reply after the interview?