Week 2 Discussion Forum

Why do we Analyze algorithm?

Why do we Analyze algorithm?

by Zafrin All Mustary -
Number of replies: 0

The analysis of algorithms is the process of finding the computational complexity of algorithms – the amount of time, storage, or other resources needed to execute them. The analysis of the algorithm is important because it gives an idea of how one algorithm scales with increase in system size and gives comparison of different algorithm. For instance, we can say that O(N) algorithm is better than O(N^2) because the former will be better on large data set as compared to later one.

Most of the times, we ignore the constant in front of the complexity. But sometimes, it becomes very important. For instance, O(10000000 N) is not as good as O(1 N^2) . In such cases, the constants also become important.


125 words