What is the big O complexity of this function?

前端 未结 0 1125
南方客
南方客 2020-12-11 22:03
def complexity(n):
      total = 0
      k = 0
      while total < n:
         total += k ** 2
         k += 1
      return k

I was thinking O(n*

相关标签:
回答
  • 消灭零回复
提交回复
热议问题