1.

Sleep sort works by ___________(a) making elements to sleep for a time that is proportional to their magnitude(b) making elements to sleep for a time that is inversely proportional to their magnitude(c) partitioning the input array(d) dividing the value of input elementsThe question was posed to me in exam.Asked question is from Sorting in section Sorting of Data Structures & Algorithms II

Answer»

The CORRECT option is (a) making elements to SLEEP for a time that is proportional to their magnitude

Explanation: In sleep sort each element is made to sleep for a time that is proportional to its magnitude. Then the elements are PRINTED in the order in which they WAKE up.



Discussion

No Comment Found

Related InterviewSolutions