This algorithm create different threads for each of the elements in the input array and then each thread sleeps for an amount of time which is proportional to the value of corresponding array element. Result is a magical sorting. Just try it, why not?