《算法导论》第一章~第五章 要点笔记
2010-11-29 10:46
218 查看
short circuiting
The boolean operators "and" and "or" are short circuiting. That is, when we evaluate the expression "x and y" we first evaluate x. If x evaluates to FALSE, then the entire expression cannot evaluate to TRUE, and so we do not evaluate y. If, on the other hand, x evaluates to TRUE, we must evaluate y to determine the value of the entire expression.
Short-circuiting operators allow us to write boolean expressions such as "x ≠ NIL and f[x] = y" without worrying about what happens when we try to evaluate f[x] when x is NIL.
random-access machine (RAM)
random-access machine (RAM) model of computation as our implementation technology and understand that our algorithms will be implemented as computer programs. In the RAM model, instructions are executed one after another, with no concurrent operations. In later chapters, however, we shall have occasion to investigate models for digital hardware.
循环
while(){}的()比{}多一步。
循环中,while语句的的()判断要比{}执行多走一步。For(){}循环同理。
时间复杂度
“It is the rate of growth, or order of growth, of the running time that really interests us.”
也就是说,时间复杂度其实度量的对象是时间增长的规模。
关于 upper bound and lower bound,书中有图:
类比:时间复杂度与比较关系
几个翻译
uniform random permutation 均匀随机排列
indicator random variables 示性随机变量
两人同一天出生的概率
More intuitively, once bi is chosen, the probability that bj is chosen to be the same day is 1/n. Thus, the probability that i and j have the same birthday is the same as the probability that the birthday of one of them falls on a given day.
文氏图表达的集合运算
Cartesian product笛卡尔积的定义
The Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs such that the first element of the pair is an element of A and the second is an element of B. More formally,
A × B = {(a b) : a ∈ A and b ∈ B}.
For example, {a, b}×{a, b, c} = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c)}. When A and B are finite sets, the cardinality of their Cartesian product is |A×B|=|A|×|B|
The Cartesian product of n sets A1, A2,..., An is the set of n-tuples(n元组)
A1 × A2 × ··· × An = {(a1, a2,..., an) : ai ∈ Ai, i = 1, 2,..., n},
The boolean operators "and" and "or" are short circuiting. That is, when we evaluate the expression "x and y" we first evaluate x. If x evaluates to FALSE, then the entire expression cannot evaluate to TRUE, and so we do not evaluate y. If, on the other hand, x evaluates to TRUE, we must evaluate y to determine the value of the entire expression.
Short-circuiting operators allow us to write boolean expressions such as "x ≠ NIL and f[x] = y" without worrying about what happens when we try to evaluate f[x] when x is NIL.
random-access machine (RAM)
random-access machine (RAM) model of computation as our implementation technology and understand that our algorithms will be implemented as computer programs. In the RAM model, instructions are executed one after another, with no concurrent operations. In later chapters, however, we shall have occasion to investigate models for digital hardware.
循环
while(){}的()比{}多一步。
循环中,while语句的的()判断要比{}执行多走一步。For(){}循环同理。
时间复杂度
“It is the rate of growth, or order of growth, of the running time that really interests us.”
也就是说,时间复杂度其实度量的对象是时间增长的规模。
关于 upper bound and lower bound,书中有图:
类比:时间复杂度与比较关系
f(n) = O(g(n)) | ≈ | a ≤ b, |
f(n) = Ω(g(n)) | ≈ | a ≥ b, |
f(n) = Θ(g(n)) | ≈ | a = b, |
f(n) = o(g(n)) | ≈ | a < b, |
f(n) = ω(g(n)) | ≈ | a > b. |
uniform random permutation 均匀随机排列
indicator random variables 示性随机变量
两人同一天出生的概率
More intuitively, once bi is chosen, the probability that bj is chosen to be the same day is 1/n. Thus, the probability that i and j have the same birthday is the same as the probability that the birthday of one of them falls on a given day.
文氏图表达的集合运算
Cartesian product笛卡尔积的定义
The Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs such that the first element of the pair is an element of A and the second is an element of B. More formally,
A × B = {(a b) : a ∈ A and b ∈ B}.
For example, {a, b}×{a, b, c} = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c)}. When A and B are finite sets, the cardinality of their Cartesian product is |A×B|=|A|×|B|
The Cartesian product of n sets A1, A2,..., An is the set of n-tuples(n元组)
A1 × A2 × ··· × An = {(a1, a2,..., an) : ai ∈ Ai, i = 1, 2,..., n},
相关文章推荐
- 【C】【笔记】《C和指针》 第一章 快速上手 第二章 基本概念 第三章 数据 第四章 语句 第五章 操作符和表达式
- 算法导论笔记(第一章)
- 算法导论第一章,第二章笔记
- 算法导论笔记第一章
- 算法导论——第五章概率分析与随机算法笔记
- 算法导论第五章笔记
- 算法导论第五章学习笔记
- 算法导论笔记第一章
- 算法导论学习笔记(五):快速排序
- 计算机网络学习笔记——第一章:计算机网络和因特网
- 算法导论 学习笔记 第五章 概率分析和随机化算法
- JavaScript设计模式学习笔记 第一章 富有表现的JavaScript
- 第一章 机器学习笔记 开始机器学习
- 090811c语言学习第五章笔记(类型变换,自定义函数,循环条件等)
- Java笔记 第一章 Java 语言概述
- 《More Effective C++ 35个改善编程与设计的有效方法》——第一章笔记
- 计算机网络自顶向下方法第一章笔记
- C++笔记:第一章
- 《算法导论》笔记 第16章 总结与思考
- 算法导论笔记之堆排序