When we write powering a number as a divide and conquer algorithm in theoretical computer science the runtime would be T(n) = 2T(n/2) + Θ(1)
in my opinion, yet according to my teacher's slides it is T(n) = T(n/2) + Θ(1)
. Why that? I added the 2 because the algorithm gets split into 2 subproblems? Am I wrong?
问问题
494 次