《數(shù)據(jù)結(jié)構(gòu)》勘誤表20170920_第1頁
《數(shù)據(jù)結(jié)構(gòu)》勘誤表20170920_第2頁
《數(shù)據(jù)結(jié)構(gòu)》勘誤表20170920_第3頁
《數(shù)據(jù)結(jié)構(gòu)》勘誤表20170920_第4頁
免費(fèi)預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、勘誤表位置原文勘誤內(nèi)容P9 例 1-4第8行;P15 第 18 行相當(dāng)于struct _node類型相當(dāng)于struct _node*類型P20順序 存儲結(jié)構(gòu) 的線性表 定義中第3行/存放線性表的數(shù)組/存放線性表的數(shù)組,此處elemtype表示數(shù) 組中的兀素類型可以是任意的,比如int, char 等P21代碼2.1代碼2.1#i nclude #i nclude #defi ne OK 1#defi ne OVERFLOW 0#defi ne LIST_INIT_SIZE 100#defi ne LISTINCREMENT 10 typedef structchar *elem;int len

2、 gth;int listsize;SqList;int In itList(SqList *L)L-elem = (char*)malloc(LIST_INIT_SIZE*sizeof(char); if (!L-elem)exit(OVERFLOW);L-le ngth = 0;L-listsize=LIST_INIT_SIZE; return OK;int mai n()int y;SqList L;y = In itList(& L);printf(y=%dn, y);return 0;P22算法2.2 第一 個(gè)單詞IntintP23代碼2.2代碼2.2#i nclude #i ncl

3、ude #defi ne OK 1#defi ne OVERFLOW 0#defi ne ERROR -1#defi ne LIST_INIT_SIZE 100#defi ne LISTINCREMENT 10typedef structchar *elem;int len gth;int listsize;SqList;int In itList(SqList *L) L-elem = (char*)malloc(LIST_INIT_SIZE*sizeof(char);if (!L-elem) exit(OVERFLOW);L-le ngth = 0;L-listsize=LIST_INIT

4、_SIZE; return OK;int ListI nsert_Sq(SqList *L, int i, char e)char *n ewbase;char *p, *q;/*特殊情況的處理*/if (i L-le ngth+1) return ERROR;if (L-length = L-listsize) /是否滿n ewbase = (char *)realloc(L-elem, (L-listsize+LISTINCREMENT)*sizeof(char);if (!n ewbase)return OVERFLOW; L-elem = n ewbase;L-listsize +=

5、LISTINCREMENT;/*插入具體操作*/q = &(L-elemi-1);for (p = &(L-elemL-le ngth-1); p = q;P-)*(p+1) = *p;*q = e;L-le ngth+; return OK;int mai n()int i, y;SqList L;y = In itList(& L);prin tf(please in put the data:); for (i = 0; i 5; i+)scanf(%c, &L.elemi); L.len gth+;y = ListI nsert_Sq(&L, 2, a); printf(the fin

6、al array is:);for (i = 0; i n extn ext)if(p-datadata)P44算法2.13 第 16 行ElseelseP48 第 20行Typedef struct Nodetypedef struct NodeP48 第 23 行Struct Node *prior, * next;struct Node *prior, * next;P49 “ 2. 雙鏈表中 結(jié)點(diǎn)的刪 除”上一 行要注意,在插入時(shí)第(4)條語句出現(xiàn)在第(1)(2)條語句的前面要注意,在插入第(4)條語句出現(xiàn)在(1) 條語句的前面,P50 第 2 行#defi ne maxsize 10

7、00#defi ne MAXSIZE 1000P50 第 3 行Typedef structtypedef structP73 第二自然段第 二行為何不能“尾進(jìn)頭出”為何不能“頭進(jìn)尾出”P63 第 18 行LSNode, Li nkStack;LSNode, *Li nkStack;P64 第 27 行*S.top+=e;刪除此行P73第 1、2行#i nclude stdio.h #i nclude malloc.h#i nclude #i nclude P73 第二 自然段第2行為何不能“尾進(jìn)頭出”為何不能“頭進(jìn)尾出”P73 第二 自然段第6行都是“頭進(jìn)尾出”都是“尾進(jìn)頭出”P79 第 9

8、 行ppQ=NULL;*ppQ=NULL;P81第26、27 行#i nclude stdio.h#i nclude malloc.h#i nclude #i nclude P82 第 25 行free(*ppQ);free(*ppQ); *ppQ=NULL;P89 圖 4-1 最后a20a1nP90 第 5 行0 i, j n-11 i, j nP90算法 4.1第8行Elemtype getelem(elemtype a, int I, int j, elemtype &e)int getelem(elemtype a, int i, i nt j, elemtype &e)P102倒數(shù) 1行如果同層的孩子結(jié)點(diǎn)左右互換如果同層的兄弟結(jié)點(diǎn)左右互換P103 第 1 行如果同層的孩子結(jié)點(diǎn)左右互換如果同層的兄弟結(jié)點(diǎn)左右互換P119 圖5-10(b)第4行點(diǎn)2,30,點(diǎn)4, 40點(diǎn) 3, 30,點(diǎn) 4, 40P123 第 11行首先將光標(biāo)停在代碼5.6第5行任意位置首先將光標(biāo)停

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論