1 / 14

3 、第 16 页 第 8 行: 的运行时间代价为 O(MAX( ( f(n) , g(n)) 。 4 、第 16 页 第 19 行:

第 1 到第 4 章的勘误表. 1 、第 9 页中的表 1.4 的第 4 行: ……class to creat 应为 ……class to creat e 2 、第 13 页的倒数第 6 行:的。这里待分类的 …… 应为: 的。这里待 排序 的 ……. 3 、第 16 页 第 8 行: 的运行时间代价为 O(MAX( ( f(n) , g(n)) 。 4 、第 16 页 第 19 行:

lilli
Télécharger la présentation

3 、第 16 页 第 8 行: 的运行时间代价为 O(MAX( ( f(n) , g(n)) 。 4 、第 16 页 第 19 行:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第1到第4章的勘误表 • 1、第 9 页中的表1.4的第4行:……class to creat 应为 ……class to create • 2、第13页的倒数第6行:的。这里待分类的…… • 应为: 的。这里待排序的…… • 3、第 16 页 第 8 行: • 的运行时间代价为O(MAX((f(n),g(n))。 • 4、第 16 页 第 19 行: • 为O(MAX(n4,n2)=O(n4),在n 为奇数时为O( MAX(n2,n3 ) =O(n3)。 注意:这个 ( 应该删除! 注意:)后应插入一个闭括号 ) • 5、第 24 页中的 倒数第 6、7 行: • template < class ElemType > • class SeqList { • 应为:template < class ElemType > • class SeqList { • 6、第 25 页中第 12 行: • int Find( ElemType e )const; 注意:这个 const应该删除! 注意应改为:因此我们把它用作哨兵单元。 • 7、第 25 页中倒数第 11 行: • …… 因此我们把用作它哨兵单元。 …… • 8、第 26 页中第 3 行: • …… ,即从1和n。…… 注意:和 应改为 到

  2. 第1到第4章的勘误表 • 9、第 26 页中第 6 行: • …… 哨兵位…… • 10、第 26 页中第 7 行: • …… 哨兵位…… 注意:位 应改为 单元 • 11、第 26 页中第 17 行: • …… 成员函数 Inser…… 注意: Inser 应改为 Insert • 12、第 28 页中第 19 行: • int SeqList Find(ElemType e )const{ 注意: const 应删除 • 13、第 31 页 图2.7应为如下所示: 注意:书上这 2 处忘记涂黑 ! (a) (b) 图2.7 双向链表和双向循环链表 (a)双向链表; (b)双向循环链表

  3. A X B A X B 第1到第4章的勘误表 • 14、第37 页的图 2.10: …… …… Current (a) …… …… P Current (b) 注意: Current 书上漏掉,请添上。 图2.10 删除操作的实现 注意: 当前结点 后漏掉 的,请添上。 • 15、第38 页的第 17 行 • ……当前结点前缀++运算符。

  4. 第1到第4章的勘误表 • 16、第 33页的倒数第 10 行: • // 构造函数:作用于另外一个迭代器 AbsListItr 的链表。 本行应改为: // 通过复制得到当前迭代器。 注意:应为 — • 17、第 36 页的第一行: • 个特殊结点-头节点……

  5. 第1到第4章的勘误表 注意:前缀 之前插入 的 • 18、第 38 页的第 17 行: • void operator ++ ( ); // 使当前结点的直接后继结点成为当前结点前缀++运算符。 • 19、第 39 页 倒数第 16 行语句: • head = r.header; • 应改为: • Exception( header != R.header, “Reference to another list, it is ERROR!” ) ; • 即整个函数为如下所示: • template <class ElemType> • const ListItr<ElemType> & ListItr<ElemType> :: operator =( const ListItr<ElemType> & R ) • { // 赋值运算符的实现。 • if ( this = = &R ) return *this; • Exception( header != R.header, “Reference to another list, it is ERROR!” ) ; • Current = R.Current; • return *this; • }

  6. A B • 20、第 41 页 的图 2.14 : C head tail (a). 注意:所示位置插入符号Λ head tail (b). 图2.14. 双链表的一种实现方案 (a). 带头结点和最后一个结点的双链表 (b). 带头结点和最后一个结点的双链表的初始化

  7. 原为 9x2 错 ! • 21、第 44 页 从第一行开始 • A = 7+3x+9x8+5x17 • B = 8x+22x7-9x8 coef exp link A.head ∧ 7 0 3 1 9 8 5 17 书上为9错! 书上为9,错! B.head ∧ 8 1 22 7 -9 8 coef exp link C.head ∧ 7 0 11 1 22 7 5 17 • 22、第 44 页 倒数第3行: • friend Is_Empty( const Term & T ){ return !T.coef: } • 即改后应为: friend int Is_Empty( const Term & T ){ return !T.coef} 注意:此处应加 int 注意:该冒号 :应删除。 注意:两处 compare 不必用黑体 • 23、第 44 页 倒数第 4 行: • friend char compare( const Term & P, const Term & T ); • 24、第 44 页倒数第 1 行:char compare( const Term & P, const Term & T ) {

  8. 25、第 45 页 倒数第3行: • while( is >> elem, !equal_stop(elem, T.Stop_flag)) Itr.Insert( elem ); 注意:原为 cin 错 ! • 26、第 48 页 图3.7: 注意:书上该箭头方向标反,请改正。 图3.1 乒乓球进盒、出盒

  9. 27、第 51 页 倒数第 12 行: • 程序3.1建立一个顺序栈,从键盘上输入8个字符并按照输入先后依次进栈,全部结束 注意:1应改为 2 • 28、第 53 页 图 3.5: 注意:该方格书上为阴影,应改为空白。 图3.5 两个栈共享一个栈空间 • 29、第 56页 第 4 行: • 插入的操作,称为进队(Enequeue)…… 注意:e应删除。 • 30、第 58 页倒数第 18 行: • static const int InitQueueSize = 10; • 即改后应为: • static const int InitQueueSize = 10; 注意: static 应为黑体。

  10. 31、第 59 页 倒数第 5 行语句: • for(int j=0, k = front; k < rear; j++, Increment(k) ) Array(j) = old[k]; • 32、第 60 页 正数第 8 行语句: • for(int j=0, k =R. front; k < R.rear; j++,Increment(k) ) Array(j) = R.Array[k]; 请将 < 改成 != 注意: 这三处 ;应删除。 • 33、第 61 页 第 6 行 到 第9行: • ~Queue ( ) { MakeEmpty( ); }; // 析构函数,释放占用的连续空间。 • void MakeEmpty ( ); // 将队列清空。 • int IsEmpty ( ) const { return front = = NULL; }; // 队空为True,否则为False。 • int IsFull ( ) const { return 0; }; // 总认为为False。 注意:if 和 else 应用黑体。 • 34、第 61 页 第 22、23 行: • if ( IsEmpty( ) ) front = rear= new ListNode <ElemType> ( x ); • else rear = rear->Next = new ListNode<ElemType> ( x ); • 35、第 62 页 第 3 行和 第 4 行之间应插入下述语句: • if ( Rp->next == NULL ) rear = p;

  11. 36、第 63页的图 3.13(f) 10 15 18 23 ∧ front (f) 注意:此箭头 ↑ 应加上

  12. ^ ^ ^ ^ 1 2 3 - - - - - 1 - 2 ^ 3 ^ ^ + + ^ ( ( ( ( 5 3 ^ ^ - ^ 4 - - - - - - 3 - ( 4 + 5 * + * + 6 * + *- 7 ( ( * * - - - - - * 6 ) * 7 注意: not 应删除。 • 37、第 66 页 第 15 行: • cout << “Comment not is unterminated!”<< endl; • 38、第 70 页 图3.16 注意:这个 1应该删除! 1 注意: enum 应改为 enum Token • 39、第 71 页 第 8 行: • 了枚据类型 enum。……

  13. 40、第 76 页 图 3.17 及其注释 5 5 6 5 6 4 4 4 1 1 1 2 3 2 2 (c) (b) (a) 5 5 1 1 1 2 (f) 2,3,4,5,6,要删除! (d) (e) 图3.17 N = 6且M = 2时的 Josephus 游戏过程 (其中,箭头指向者为本轮游戏开始时的持土豆者) (a) 初态; (b) 2,3号删除之后;(c) 3,6号删除之后;(d)4,4号删除之后; (e)5,2号删除之后;(f) 6,5号删除后,1号为最终胜者

  14. 41、第 76 页 倒数第 8 行: • if ( !P.RemoveNext( ) ) { // 删除下一个结点,若当前结点是尾结点,则 注意: 在此处插入: 若下一个结点存在,则删除成功,函数 P.RemoveNext()返回值True;若下一个结点不存在,则删除失败, 函数P.RemoveNext()返回值 False。

More Related