COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Find the slowest algorithm:
|
O (n)
|
|
O (n^2)
|
|
O (n!)
|
|
O (2^n)
|
Explanation:
Detailed explanation-1: -HeapSort: It is the slowest of the sorting algorithms but unlike merge and quick sort it does not require massive recursion or multiple arrays to work.
Detailed explanation-2: -The last Big-O notation I’ll explain here is called Big-O of N factorial. This is the slowest of all and if you have this type of algorithm, then you’re in big trouble.
Detailed explanation-3: -The worst case best run time complexity is O(nlogn) which is given by-Merge Sort and Heap Sort.
Detailed explanation-4: -Quadratic algorithms are slow (and hashmaps are fast)
There is 1 question to complete.