Time Complexity of Ternary Search Algorithm

后端 未结 2 1909
离开以前
离开以前 2021-01-07 05:47

I have an assignment that wants me to write an ternary search algorithm and compute its time complexity afterwards. I was able to write an algorithm for it but I couldn\'t c

2条回答
  •  长发绾君心
    2021-01-07 05:55

    It is Θ(log3(N)). To check how to calculate complexity just check http://en.wikipedia.org/wiki/Big_O_notation

    To read more about ternary search, just check the wikipedia page also: http://en.wikipedia.org/wiki/Ternary_search

提交回复
热议问题