In this article, the importance of asymptotic analysis is explained, followed by the introduction to asymptotic notations. The worst, average, and best case time complexity analysis are also briefly discussed.
Let’s assume we have two most popular sorting algorithms implemented -
Where a and b are constants, and n is the input size. Intuitively we know, n² > n*log n, for any input size n > 0.
Now consider a situation: The insertion sort is implemented in one of the fastest programming languages say C++, and…