Skip to main content

Posts

Showing posts with the label The Crazy Programmer How to Calculate Running Time of an Algorithm? How to Calculate Running Time of an Algorithm? The Crazy Programmer

How to Calculate Running Time of an Algorithm? Vijay Sinha The Crazy Programmer

In this article, we will learn how to deduce and calculate the Running Time of an Algorithm. Also, we will see how to analyze the Time Complexity of the Algorithm. This is very useful when it comes to analyzing the efficiency of our solution. It provides us with the insight to develop better solutions for problems to work on. Now, the Running Time of an Algorithm may depend on a number of factors : Whether the machine is a Single or Multiple Processor Machine. It also depends on the cost of each Read/Write operation to Memory. The configuration of machine – 32 bit or 64 bit Architecture. The Size of Input given to the Algorithm. But, when we talk about the Time Complexity of Algorithm we do not consider the first 3 factors. We are concerned with the last factor i.e. how our program behaves on different Input Sizes. So, mostly we consider the Rate of Growth of Time with respect to the input given to the program. Now, to determine the Run time of our program, we define a Hypothe