Is this time complexity calculation right?

后端 未结 0 1510
暗喜
暗喜 2021-02-13 09:31

I was trying to make a code working like Array.prototype.indexOf with big O(n).
it is how I calculate Big O of my code. is it right?

n = haystack.length
when

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