!!!Chapter 1 Introduction
2013-04-08 21:27
295 查看
1.2 Mathematics Review
Exponents
http://baike.baidu.com/view/5711140.htmLogarithms
http://en.wikipedia.org/wiki/LogarithmSeries
arithmetic series 等差数列:Sn=n(a1+an)/2
geometric series
等比数列:
Sn=a1(1-q^n)/(1-q)=(a1-an*q)/(1-q)
http://baike.baidu.com/view/39749.htm
Modular Arithmatic
A is congruent to B modulo N, written A ≡ B (mod N), if N divides A - B.e.g.
81 ≡ 61 ≡ 1 (mod 10)
The P Word
The two most common ways of proving statements in data structure analysis are proof by induction(归纳) and proof by contradiction(反证).Induction
1. proving a base case
2. assume k works and prove k + 1 will work
Contradiction
Assuming that the theorem is false and showing that this assumption implies that some known property is false.
1.3 Recursion
A function defined in terms of itself is called recursive.F(x) = 2F(x-1) + X
C allows functions to be recursive:
int F(int X) { // handle base case if(X == 0) return 0; else return 2*F(x - 1) + X; }Recursive calls will keep on being made until a base case is reached.
Fundamental rules of recursion:
1. Base case. You must always have some base cases, which can be solved without recursion.
2. Making progress. For the cases that are to be solved recursively, the recursive call must always be to a case that makes progress toward a base case.
3. Design rule. Assume that all the recursive calls work.
4. Compound interest rule. Never duplicate work by solving the same instance of a problem in separate recursive calls.
相关文章推荐
- Introduction to Algorithm(chapter 7)
- Chapter 1:Introduction
- PRML Notes-Chapter1 Introduction(1.2 Probability Theory)
- SymmetricDS文档翻译--【Chapter 1. 简介(Introduction)】
- Introduction to Algorithm - Summary of Chapter 7 - Quicksort
- 深入理解Linux内核 Chapter1 introduction
- Introduction to Algorithms Chapter 12: Binary Search Tree
- 【PRML读书笔记-Chapter1-Introduction】1.4 The Curse of Dimensionality
- 移动端web开发 chapter 1 – introduction
- PRML学习心得:Chapter1—Introduction
- Introduction to Algorithm(chapter 14)
- OpenGL ES2.0 Programming Guide - chapter 3:An introduction to EGL
- Chapter 1 Introduction
- Introduction to Algorithms Chapter 13: Red Black Tree
- Chapter 6. Introduction to ASP.NET
- Chapter 1. Introduction to Vectors
- Reinforcement Learning:An Introduction 读书笔记- Chapter 1
- 《ActiveMQ In Action》Chapter 1 Introduction to Apache ActiveMQ
- Introduction to Algorithm(chapter 11)
- Chapter 1 Introduction