What is the worst case time complexity of bogosort?

What is the worst case time complexity of bogosort?
A. O(n$^{2}$)
B. O(n*n!)
C. O(infinity)
D. O(n log n)
 
Answer: c
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).
 

Tìm kiếm

Back
Top