Master's theorem with f(n)=log n

后端 未结 3 1789
半阙折子戏
半阙折子戏 2020-12-11 18:54

For master\'s theorem T(n) = a*T(n/b) + f(n) I am using 3 cases:

  1. If a*f(n/b) = c*f(n) for some constant c > 1 then
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-11 19:29

    You might find these three cases from the Wikipedia article on the Master theorem a bit more useful:

    • Case 1: f(n) = Θ(nc), where c < logb a
    • Case 2: f(n) = Θ(nc logk n), where c = logb a
    • Case 3: f(n) = Θ(nc), where c > logb a

    Now there is no direct dependence on the choice of n anymore - all that matters is the long-term growth rate of f and how it relates to the constants a and b. Without seeing more specifics of the particular recurrence you're trying to solve, I can't offer any more specific advice.

    Hope this helps!

提交回复
热议问题