Question d’entretien chez BrowserStack

Sort an array having N elements where every element is < N. The array has no duplicate values.

Réponses aux questions d'entretien

Utilisateur anonyme

23 févr. 2017

Well this is a simple one where there index can be found using % N and place the value in that index to sort it.

2

Utilisateur anonyme

8 juil. 2016

Count sort

Utilisateur anonyme

14 juil. 2016

If every element is less than N and there are no duplicates, that means elements are between 0 and N-1 inclusive. Just store them in order.