Bogosort Multiple choice Questions and Answers (MCQs)

 

 Buy/Download all MCQ Ebook   >>>Click Here<<<

Bogosort Multiple choice Questions and Answers (MCQs)

Click on any option to know the CORRECT ANSWERS

Question 1
Which of the following is not an alternative name of bogosort?
A
stupid sort
B
permutation sort
C
donkey sort
D
monkey sort


Question 1 Explanation: 
Bogosort is also known by names like stupid sort, monkey sort, permutation sort, slow sort and shotgun sort.These names are particularly chosen due to its inefficient algorithm.

Question 2
Bogosort works by .....
A
generating random permutations of its input
B
partitioning the array
C
dividing the value of input elements
D
generating permutations according to the value of first element of array


Question 2 Explanation: 
Bogosort algorithm successively generates permutations of its input. This process is repeated until the sorted version of the array is found.

Question 3
What is the auxiliary space requirement of bogosort?
A
O(n)
B
O(1)
C
O(log n)
D
O(n log n)


Question 3 Explanation: 
Bogosort algorithm do not require any extra space for sorting the input array. Thus its auxiliary space requirement is O(1).

Question 4
What is the best case time complexity of bogosort?
A
O(n2)
B
O(n)
C
O(n log n)
D
O(1)


Question 4 Explanation: 
Best case time complexity of bogosort occurs when the input array is already sorted. So in such a case we only need to check whether all the elements are sorted which can be done in O(n) time.

Question 5
What is the worst case time complexity of bogosort?
A
O(n2)
B
O(n*n!)
C
O(infinity)
D
O(n log n)


Question 5 Explanation: 
There is no upper bound to the worst case of this algorithm. It can go on to take very large amount of time if the array has many elements. So the worst case of this algorithm can be taken as O(infinity).

There are 5 questions to complete.

 

 Buy/Download all MCQ Ebook >>>CLICK HERE<<<