What is the fastest way of calculating Time Complexity of any code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the fastest way of calculating Time Complexity of any code?

Specifically in Order of Growth(O).

2nd Feb 2020, 7:07 AM
KnightCoder
KnightCoder - avatar
1 Answer
+ 1
Time complexity(TC) is just the time needed by your program to run till its completion.There is no such fast way to calculate TC of a code.The TC is not the same for every code you create because the algorithm's performance varies on different types of input data.For an algorithm,it is necessary that you mention only the maximum time taken by the algorithm for any input size i.e.,worst case TC.
2nd Jun 2020, 6:55 AM
Pevin Alfred.T.C