1.

Sleep sort does gives a correct output when ___________(a) any input element is negative(b) input array is reverse sorted(c) any input element is positive(d) when there is a very small number to the left of very large numberI have been asked this question by my college professor while I was bunking the class.My query is from Sorting topic in division Sorting of Data Structures & Algorithms II

Answer»

The CORRECT CHOICE is (C) any input element is positive

Easy explanation - Sleep sort gives a sorted output when the array elements are positive. But when any other case than this occur out of the above GIVEN cases then we MAY not see a correct output. This makes sleep sort very unreliable sorting technique.



Discussion

No Comment Found

Related InterviewSolutions