week01

伪代码,时间复杂度,空间复杂度,平均复杂度与最差复杂度

Counting Primitive Operations:数伪代码中的原子操作(每行代码执行多少次)

Recursive Algorithms:递归算法(我调用我自己

1. Asymptotic notation渐进表示(时间复杂度

Used in a simplified analysis that estimates the number of primitive operations executed up to a constant factor

1.1. Asymptotic Algorithm Analysis:渐近算法分析

use the worst-case number of primitive operations executed as a function of the input size

Example:
• We determine that the algorithm “Maximum-Element(A) ” executes at most 7n - 2 primitive operations
• We say that algorithm “runs in O(n) time”

Since constant factors and lower-order terms are eventually dropped anyhow, we can disregard them when counting primitive operations