Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 513 Bytes

File metadata and controls

10 lines (8 loc) · 513 Bytes

Sleep sort is a sorting algorithm where

  • a thread are created for every element in the unsorted list
  • put the thread on sleep for a certian amount of time i.e., if the element is 2, make the thread sleep for 2 units.
  • print the element or store the elment.

So basically, larger the value longer sleep period for the thread, smaller the value less sleep period for the thread which leads the program to sort the given array.

Source StackExchange