Introduction to The Design and Analysis of Algorithms (1)
来源:互联网 发布:旅游市场数据 编辑:程序博客网 时间:2024/06/10 06:36
最近两周看了这本书的第一章和第二章,摘抄书中部分句子做个小总结。
1. 如果一个排序算法保留了等值元素在输入中的相对顺序,就可以说它是稳定的(stable).
例 习题1.3 1
算法 comparisonCountingSort(A[0...n-1]) // 对数组排序 for i <- 0 to n-1 do count[i] <- 0 for i <-0 to n-2 do for j <- i+1 to n-1 do if A[i] < A[j] count[j] <- count[j]+1 else count[i] <- count[i]+1 for i<- 0 to n-1 do S[count[i]] <- a[i] return S
该算法就是不稳定的。
若将if A[i] < A[j]
改为if A[i] <= A[j]
则是稳定的。
2. 数据结构(data structure) : 对相关的数据项进行组织的特殊结构。
3. 抽象数据类型(abstract data type ADT) 是由一个表示数据项的抽象对象集合和一系列对这些对象所做的操作构成的。
4. 算法的时间效率和空间效率都用输入规模的函数进行度量。用算法基本的执行次数来度量算法的时间效率;通过计算算法消耗的额外存储单元的数量来度量时间效率。
5. 算法有数学分析、经验分析和可视化。
6. 算法的经验分析是针对一个输入样本运行算法的一个程序实现,然后分析观测到的数据(基本操作次数或物理运行时间)。这种方法的主要优点是可以应用于任何算法,主要缺点是要依赖于特定的计算机和输入样本。
0 0
- Introduction to The Design and Analysis of Algorithms (1)
- Introduction to The Design and Analysis of Algorithms (2)
- Design and Analysis of Distributed Algorithms
- Cousera:Algorithms: Design and Analysis, Part 1
- My Study experience of Design and Analysis of Algorithms (Part 1)
- Stanford - Algorithms: Design and Analysis, Part 1 - Week 1 Assignment: number of inversions
- Ex5.1-3 of Introduction to Algorithms
- Ex5.1-2 of introduction to algorithms
- 5. Probabilistic Analysis and Randomized Algorithms——Introduction to Algorithms Third Edition
- Stanford Algorithms: Design and Analysis, Part 1[week 1]
- Stanford Algorithms: Design and Analysis, Part 1[week 2]
- Stanford Algorithms: Design and Analysis, Part 1[week 3]
- Stanford Algorithms: Design and Analysis, Part 1[week 4]
- Stanford Algorithms: Design and Analysis, Part 1[week 5]
- Stanford Algorithms: Design and Analysis, Part 1[week 6]
- Stanford Algorithms: Design and Analysis, Part 1 [Final Exam]
- Stanford Algorithms: Design and Analysis, Part 2[week 1]
- Stanford: Algorithms: Design and Analysis, Part 1 [Week 2]
- Android中ArrayAdapt&SimpleAdapt的使用
- 3.C语言常用运算符
- Codeforces Round #345 (Div. 2)(B)暴力
- 【BZOJ1066】【SCOI2007】蜥蜴(网络流isap)
- http://blog.csdn.net/liang12360640/article/details/50350648
- Introduction to The Design and Analysis of Algorithms (1)
- NBUT 1655 木块拼接【想不明白】
- 在Activity里显示列表(ListView的布局)
- 链接
- ShellSort
- PKU1038 Bugs Integrated, Inc. 状压DP
- 集体智慧编程——神经网络预测点击率-Python实现
- 对于已知二叉树的中序遍历和后序遍历如何求二叉树的的前序遍历
- 90. Subsets II LeetCode