时间复杂度 - Time Complexity
- 为什么数据结构也有期中
, , ,
Notations
大O
if there are positive constants and such that when
简单理解为
大Ω
if there are positive constants and such that when
简单理解为
大Θ
if and only if and
简单理解为
小o
if, for all positive constants , there exists an such that when . Less formally, if and
简单理解为
Proof by induction
通常采用数学归纳法证明,我们只需要找出一个
以及对应的 即可。证伪时,我们采用反证法,通常证明极限情况下( ) 不存在 ( )
证明
例如证明
首先观察得
随后由 Inductive Hypothesis:
那么对于 n+1 的情况
因为
因此假设对于
证伪
另一个证伪的例子是
我们假设
那么当
因为极限不存在,因此