Text Generator Brain 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 (nk)

  • star

    O(n2 * k2)

  • star

    O(n*n*logk)

  • star

    O((nk))

try it yourself: Text Generator Playground - Calculate Time Complexity