- Published on
Math for algorithms
- Authors
- Name
- Lucas Xu
- @xianminx
Math basics for algorithm
A.1 求和公式及其性质
- 等差
- 线性性质
- 几何级数
- 调和级数
- 级数积分与微分
- 列项级数 telescopes
- 乘积
A.2 确定求和时间的界
数学归纳法
确定级数中各项的界
通过积分求和的近似
if 单调递增:
if 单调递减:
重点
Illustrate function call stack
Describe how to convert recursion to iteration
one function call
2 or more function calls
tail recursion
PERMUTATION
PERM(A, k)
if(k == n)
PRINT(A)
for i = 1 to n
SWAP(A, i, k)
PERM(A, k+1)
SWAP(A, i, k)
PERM(A, 1)
DFS and stack
BFS and queue