Problem Solving: Sort an Array

You have an array of size ‘n’ with numbers from 1 to ‘n’. You need to sort this array in the most optimal way.

HINT(Don’t read the hint if you think you can do without it): The solution has a complexity of O(n). i.e. even less than the O(n.log(n)) which is given by the best sorting algorithms.

Find the answer in the comments section.


About this entry