Sleep Sort Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Sleep Sort Multiple choice Questions and Answers (MCQs)

Question 1
Which of the following header file is a must to implement sleep sort algorithm?
A
string.h
B
math.hw
C
bios.h
D
windows.h
Microbiology Questions answers
Question 1 Explanation: 
To implement sleep sort algorithm we need functions like WaitForMultipleObjects(), ....beginthread(). These are included in the header file windows.h.

Question 2
Sleep sort does not work for .....
A
negative numbers
B
large numbers
C
small numbers
D
positive numbers
Home science Questions answers
Question 2 Explanation: 
Sleep sort algorithm does not work for negative numbers. It is because thread cannot sleep for negative amount of time.

Question 3
In how many comparisons does the array arr={1, 4, 2, 3, 5} gets sorted if we use sleep sort?
A
5
B
3
C
1
D
0
Puzzles Questions answers
Question 3 Explanation: 
Sleep sort makes different elements of the array to sleep for an amount of time that is proportional to its magnitude. So it does not require to perform any comparison in order to sort the array.

Question 4
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 elements
Home science Questions answers
Question 4 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.

Question 5
Sleep sort code cannot compile online because .....
A
it has very high time complexity
B
it has very high space complexity
C
it requires multithreading process
D
online compilers are not efficient
Sociology Questions answers
Question 5 Explanation: 
Sleep sort requires multithreading process for making the elements to sleep. This process happens in the background at the core of the OS and so cannot be compiled on an online compiler.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<