摘要: 10.1 Procedural and object oriented programming ) In procedural programming, you first concentrate on the procedures you will follow ) In OOP, you con 阅读全文
posted @ 2018-10-07 11:40 Gabriel_Ham 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 9.3 Namespaces namespace problems The conflict of using same name things from different libraries. For example, two libraries might both define classe 阅读全文
posted @ 2018-10-07 09:26 Gabriel_Ham 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 9.2.10 Storage schemes and dynamic allocation Memory allocated by new operator is called dynamic memory. Dynamic memory is controlled by new and delet 阅读全文
posted @ 2018-10-05 22:50 Gabriel_Ham 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 9.2.4 Static duration, external linkage ) External variables External variables are defined outside, thus external to any function.It is also termed g 阅读全文
posted @ 2018-10-05 21:12 Gabriel_Ham 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 10.10 查找列表 ) 线性查找 线性查找顺序地将关键字key与列表中的每一个元素进行比较,直到找到某个匹配元素时返回其下标,亦或在找不到时返回 1。代码如下: 若关键字存在,线性查找在找到关键字前平均需要查找一半的元素,其运行时间与列表中的元素个数成正比(时间复杂度为O(n)?)。这样的效率十分 阅读全文
posted @ 2018-10-04 15:06 Gabriel_Ham 阅读(225) 评论(0) 推荐(2) 编辑
摘要: 10.3 实例研究:乐透数 编写程序决定输入数字是否涵盖了1 99之间的所有整数: 10.4 实例研究:一副扑克牌 在一副扑克牌中随机抽出四张并显示花色与数字: 10.5 扑克牌图形用户界面 给出一个图形用户界面,单机shuffle按钮,显示四张随机扑克牌的图像: 10.6 复制列表 想到复制列表时 阅读全文
posted @ 2018-10-04 10:41 Gabriel_Ham 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 10.1 引言 )Python提供一种称为 列表 的数据类型来存储一个有序的元素集合。Python中的列表(不像部分语言中的数组)大小可变。 10.2 列表基础 )创建列表 注意,python的列表中的元素可以是不同类型,如上例list5所示 )列表使用的操作与函数 操作|描述|操作|描述 |: : 阅读全文
posted @ 2018-10-04 09:31 Gabriel_Ham 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 9.1 Separate compilation ) C++ could compile multiple files separately and link them into the final executable program ) You can divide original progr 阅读全文
posted @ 2018-09-29 22:18 Gabriel_Ham 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Exercise 3: Exercise 5: Exercise 6: 阅读全文
posted @ 2018-09-27 22:11 Gabriel_Ham 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 8.5.2 Overloaded Templates ) As with ordinary overloading, overloaded templates need distinct function signatures: also note from this example that no 阅读全文
posted @ 2018-09-27 16:00 Gabriel_Ham 阅读(163) 评论(0) 推荐(0) 编辑