search

Home  >  Q&A  >  body text

c++ - 求解T(n)<T(7n/10)+kn+b

求解T(n)<T(7n/10)+kn+b的时间复杂度,k>0.
这题答案是O(n),但是我求不出来。

天蓬老师天蓬老师2803 days ago558

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 15:22:19

    a = 1, b = 10/7, logba = 0
    f(n) = n1 where 1 > logba = 0

    7n/10 <= kn, k = 7/10
    所以用master theorem case 3,
    T(n) = Θ(n)

    reply
    0
  • Cancelreply