Pregunta de entrevista de BrowserStack

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

Respuestas de entrevistas

Anónimo

23 feb 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

Anónimo

8 jul 2016

Count sort

Anónimo

14 jul 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.