Showing posts with label Time Complexity. Show all posts
Showing posts with label Time Complexity. Show all posts

Saturday, October 31, 2015

How to find Time Complexity of an Algorithm

26 comments:
We can come up with several algorithms for a particular problem. But we need to choose the best algorithm that suits us. Hence we need to compare several algorithms and select the best algorithm.

Therefore, goal of analysis of algorithms is to compare algorithms with several factors like running time, memory, effort of developing, etc. Ideal factor to be selected for comparison purpose is running time of the algorithm which is a function of input size, n. Since running time is a function of input size it is independent of execution time of the machine, style of programming etc.