Text Generator
Text Generator > Use Cases >Calculate Time Complexity

Calculate Time Complexity

Find the time complexity of a function.

Example input

  • def foo(n, k): accum = 0 for i in range(n): for l in range(k): accum += i return accum """ The time complexity of this function is

Example real generated results

  • star

    O((log n + log (k+1))).

  • star

    O((log n + log (k+1)) / 4)

  • star

    O((k+1)(n2-l+1)) and the memory required to keep track on a vector are linear.

  • star

    O ( n*K ). There are also other functions which have similar forms. The main goal here was to demonstrate that all these types can be evaluated as the sum.

try it yourself: Text Generator Playground - Calculate Time Complexity