Review master theorem

For recurrent relation with the following format:

\(T(n) = a T(\frac{n}{b}) + f(n)\)

Let \(c=\log_b a\) be the critical exponent. Master theorem compares the relative growth of \(f(n)\) and \(n^{c}\), specifically:

  • if \(\exists \epsilon \gt 0\), \(f(n) \in O(n^{c-\epsilon})\), which means \(f(n)\) is upper bounded by \(n^c\), then \(T(n) \in \Theta(n^c)\);
  • if \(\exists k \geq 0, f(n) \in \Theta(n^c \log^{k}n)\), which means \(f(n)\) grows in the same order as \(n^c \log^k n\), then, \(f(n) \in \Theta(n^c log^{k+1}n)\)
  • if \(\exists \epsilon \gt 0\), \(f(n) \in \Omega(n^{c+\epsilon})\) and \(\exists c<1, a f(\frac{n}{b}) < cf(n)\) for all sufficiently large \(n\), then \(T(n) \in \Theta(f(n))\)

Some examples:

  1. \(T(n) = 3T(n/2) + n^2\)
  2. \(T(n) = 4T(n/2) + n^2\)
  3. \(T(n) = 10T(n/3) + n^2\)
  4. \(T(n) = 2T(n-1) + 1\) Tower of Hanio
  5. \(T(n) = T(\sqrt{n}) + 1\)
  6. \(T(n) = 2T(n/2) + n\log n\)

Relation 4) and 5) cannot be solved by master theorem, but could be solved by iterated substitution.

This is a test of markdown

\(T(n) = O(n) + \frac{1}{n} \sum_{k=1}^{n}T(n-k)\)

iterated substitution:

转载于:https://www.cnblogs.com/gaoqichao/p/9121467.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值