数据结构与算法分析
参考书籍:[1]Clifford A.Shaffer.数据结构与算法分析[M].北京:电子工业出版社,2020.
Chapter 1 Data Structures and Algorithms
1.4 Problems, Alogorithms, and Programs
Q:What can be called an algorithm?
1.It must be correct.
2.It is composed of a series of concrete steps.
3.It is no ambiguity.
4.It must be composed of a finite number of steps.
5.It must terminate.
Chapter 2 Mathematical Preliminaries
2.3 Logarithms 对数
若 log 2 x = y \log_2 x=y log2x=y,则2可省略: log x = y \log x=y logx=y。
Chapter 3 Algorithm Analysis*
Asymptotic analysis attempts to estimate the resource consumption of an algorithm.
3.1 Introduction
growth rate
2 < log 2 x \log_2 x log2x < n 2 / 3 n^{2/3} n2/3 < n < n 2 n^2 n2 < 3 n 3^n 3n < n!
3.4 Asymptotic Analysis 渐近分析
Upper Bounds 上限: O ( g ( n ) ) O\left(g(n)\right) O(g(n))
Lower Bounds 下限: Ω ( g ( n ) ) \varOmega \left(g(n) \right) Ω(g(n))
当上限下限一样时用: Θ ( g ( n ) ) \varTheta \left(g(n) \right) Θ(g(n))
Simplifying Rules 化简法则
1.省略常系数: Θ ( k g ( n ) ) = Θ ( g ( n ) ) \varTheta \left(kg(n) \right)=\varTheta \left(g(n) \right) Θ(kg(n))=Θ(