TonyYin's Blog

Back

主定理#

将一个规模为 nn 的问题,分治为 aanb\lfloor\dfrac{n}{b}\rfloor 的子问题,每次带来的额外计算为 O(nd)\mathcal{O}(n^d),可得到以下关系式:

T(n)=aT(nb)+O(nd)T(n)=aT(\lceil\dfrac{n}{b}\rceil)+\mathcal{O}(n^d) (forconstantsa>0,b>1,d0),then:(\text{for\,constants\,}a>0,b>1,d\ge0),\text{then}: T(n)={O(nd),d>logbaO(ndlogn),d=logbaO(nlogba),d<logbaT(n) = \begin{cases} \mathcal{O}{(n^d)}, & \quad d>\operatorname{log}_ba\\ \mathcal{O}{(n^d\operatorname{log}n)}, & \quad d=\operatorname{log}_ba\\ \mathcal{O}{(n^{\operatorname{log}_ba})}, & \quad d<\operatorname{log}_ba\\ \end{cases}
主定理
https://www.tonyyin.top/blog/oi-notes/main-theory
Author TonyYin
Published at September 23, 2022
Comment seems to stuck. Try to refresh?✨