DEV Community

loading...
Cover image for Explain TimeComplexity Like I'm Five

Explain TimeComplexity Like I'm Five

himan10 profile image Himanshu Bhatnagar ・1 min read

Hello Everyone, currently I was working on time complexity for python programs ... I know about time complexity and yeah I reduced the complexity from a huge amount of seconds but still, I can't figure out some reasons i.e.,

  1. Why adding some external functions(like logging.debug()) in my algorithm somewhere results in an increase the run time of an algorithm?

  2. what if I choose a mathematical equation over iterations, assignment and return process. How can the time complexity affect our algorithm in this case?

  3. Time complexity is an essential part to calculate but in some cases, it may affect the average clock and CPU usage by keeping one cpu busy. How to resolve this problem?

Discussion (0)

Forem Open with the Forem app