Programming Abstractions in C 阅读笔记:p293-p302
《Programming Abstractions in C》学习第 73 天,p293-p302 总结,总计 10 页。
一、技术总结
1.时间复杂度
(1)quadratic time(二次时间)
p293, Algorithms like selection sort that exhibit O(N^2) performance are said to run in quadratic time。
2.线性查找(linear search)
p293, Because the for loop in the implementation executes n time, you expect the performance of LinearSearch——as its name implies——to be O(N)。时间复杂度为 O(N)的查找称为线性查找。
3.归并排序(merge sort)
书中并为对归并排序做严格的定义。p298, The merge operation, combined with recursive decomposition, gives rise to a new sorting algorithm called merge sort, which you can implement in straightforward way. The basic idea of the algorithm can be outlined as follows:
Check to see if the array is empty or has only one element. If so, it must alread be sorted, and the function can return without doing any work. This condition defines the simple case for the recursion.
Divide the array into two new subarrays, each of which is half the size of the original.
Sort each of the subarrasy recursively.
Merge the two subarrays back into the original one.
二、英语总结
1.quadratic 是什么意思?
答:In mathematics by 1660s;the algebraic quadratic euqation(二次方程, 1680s) are so called because they involve the square(x^2) and no higher power of x。这里要注意 quarter 是四分之一,但是 quadratic 是二次(x^2)的意思。
2.sophistication 是什么意思?
答:
(1)sophist > sophiticate > sophistication。
(2)sophist: one who makes use of fallacious arguments(诡辩者)。
(3)sophistication: u. the quality of being sophisticated(老练, 复杂度)。
p293, The problem, howerver is that average-case analysis is much more difficult to carry out and typically requires considerable mathematical sophistication。这里比较重要的一点是虽然这里用的是名词 sophistication,但是因为翻译的时候需要转一下,mathematical sophistication(复杂的数学知识)。
3.average 用法总结
答:
(1)vt. to reach a particular amount as an average。主语可以是物也可以是人。翻译的时候需要灵活转变。
主语是物:Inquires to our office average 1000 calls a month.
主语是人:p294, From a practical point of view, it is often useful to consider how well an algorithm performs if you average its behavior over all possible sets of input data
三、其它
本书中作者讲解归并排序(merge sort)和其它书还是有些不同的,从选择排序算法展开,从而引出归并排序算法,可以和其它书进行对比阅读。
四、参考资料
1. 编程
(1)Eric S.Roberts,《Programming Abstractions in C》:https://book.douban.com/subject/2003414
2. 英语
(1)Etymology Dictionary:https://www.etymonline.com
(2) Cambridage Dictionary:https://dictionary.cambridge.org
欢迎搜索及关注:编程人(a_codists)
版权声明: 本文为 InfoQ 作者【codists】的原创文章。
原文链接:【http://xie.infoq.cn/article/23c8ecf4cef3af67ec2e25f24】。未经作者许可,禁止转载。
评论