time complexity
Time Complexity Time Complexity of algorithm/code is not equal to the actual time required to execute a particular code but the number of times a statement executes. You will get surprising results i.e. for N = 10 you may get 0.5ms time and for N = 10, 000 you may get 0.2 ms time. Also, you will get different timings on the different machine. So, we can say that actual time requires to execute code is machine dependent (whether you are using pentium1 or pentiun5) and also it considers network load if your machine is in LAN/WAN. Even you will not get the same timings on the same machine for the same code, the reason behind that the current network load. Now, the question arises if time complexity is not the actual time require executing the code then what is it? The answer is : Instead of measuring actual time required in executing each statement in the code, we consider how many times each statement execute. How to Compare Algorithms? To compare...