freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)教案-資料下載頁

2025-09-22 07:34本頁面
  

【正文】 ch? if(T){ Push(S,T173。data)? if(!T173。lchildamp。amp。!T173。rchild)//如果左指針和右指針同時(shí)為空,才說明該節(jié)點(diǎn)為葉子節(jié)點(diǎn)PrintStack(S)? else { AllPath(T173。lchild,S)? AllPath(T173。rchild,S)? } Pop(S,amp。ch)? } } 4.參考代碼為:BiThrTreepre?voidPreThreading(BiThrTreep)//先序線索化 { if(p){ if(!p173。lchild){ p173。LTag=Thread?p173。lchild=pre? //前驅(qū)線索 } if(!pre173。rchild){ pre173。RTag=Thread?pre173。rchild=p? //后繼線索 } pre=p? if(p173。LTag==Link)PreThreading(p173。lchild)?//左子樹線索化 if(p173。RTag==Link)— 3—教學(xué)過程及內(nèi)容PreThreading(p173。rchild)?//右子樹線索化} } BiThrTreePreOrderThreading(BiThrTreeT)//先序線索二叉樹 { BiThrTreethrt? if(!(thrt=(BiThrTree)malloc(sizeof(BiThrNode))))returnNULL? thrt173。LTag=Link?thrt173。RTag=Thread?//建頭結(jié)點(diǎn) thrt173。rchild=thrt?//右指針回指 if(!T)thrt173。lchild=thrt?//空二叉樹 else { thrt173。lchild=T? pre=thrt?PreThreading(T)?//先序遍歷進(jìn)行先序線索化pre173。rchild=thrt?pre173。RTag=Thread?//最后一個(gè)結(jié)點(diǎn)線索化 thrt173。rchild=pre? } returnthrt?} voidPreOrderTraverse_Thr(BiThrTreethrt)//先序遍歷二叉樹 { BiThrTreep?printf(“先序遍歷結(jié)果為:”)? p=thrt173。lchild? while(p!=thrt){ printf(“%3c”,p173。data)? while(p173。LTag==Link){ p=p173。lchild?printf(“%3c”,p173。data)? } p=p173。rchild? } printf(“n”)? }— 4— 授課進(jìn)度第13周,第24次課(2學(xué)時(shí))授課題目(教學(xué)章、節(jié)實(shí)驗(yàn)六哈夫曼樹 或主題)授課日期016年11月23日(11 2月22日).理解哈夫曼樹的特征及其應(yīng)用。,構(gòu)造哈夫曼樹,并用構(gòu)造的哈夫曼樹進(jìn)行編 2 碼和譯碼。教學(xué) 目標(biāo) ,使學(xué)生對數(shù)據(jù)結(jié)構(gòu)的應(yīng)用有更深層次的理解。教學(xué) 。重點(diǎn)。教學(xué) 難點(diǎn)請選擇你授課時(shí)所采用的教學(xué)方法(在括號中畫“√”):講授法﹝﹞,討論法﹝﹞,演示法﹝﹞,案例法﹝﹞,發(fā)現(xiàn)法﹝﹞,探究法﹝﹞,教學(xué)談話法﹝﹞,實(shí)驗(yàn)法﹝√﹞,參觀法﹝﹞,考察法﹝﹞,自學(xué)輔導(dǎo)法﹝﹞,練習(xí)方法法(習(xí)題或操作課)﹝√﹞,讀書指導(dǎo)法﹝﹞,聽說法﹝﹞,寫生法﹝﹞,視唱 法﹝﹞,工序法(技能課)﹝﹞,實(shí)習(xí)作業(yè)法﹝﹞,其他﹝﹞ 教學(xué)實(shí)物﹝﹞,多媒體﹝﹞,投影﹝﹞,影像﹝﹞,CAI課件﹝﹞,PPT﹝√﹞,標(biāo)本手段﹝﹞,掛圖﹝﹞,模型﹝﹞,其他﹝﹞ 討 論、思考 題、作業(yè)[ 1]李素若,陳萬華,:中國水利水電出版社,2014.[ 2]李素若,陳萬華,:中國水利水 請選擇你授課時(shí)所采用的教學(xué)手段(在括號中畫“√”):參考電出版社,教學(xué)過程及內(nèi)容一、實(shí)驗(yàn)內(nèi)容1.哈夫曼樹問題。利用哈夫曼編碼進(jìn)行通訊可以大大提高信道利用率,縮短信息傳輸時(shí)間,降低傳輸成本。但是,這要求在發(fā)送端通過一個(gè)編碼系統(tǒng)對待傳數(shù)據(jù)進(jìn)行預(yù)先編碼;在接受端將傳來的數(shù)據(jù) 進(jìn)行解碼(復(fù)原)對于雙工信道(即可以雙向傳輸?shù)男诺溃慷硕家幸粋€(gè)完整的編/譯碼 系統(tǒng)。試為這樣的信息收發(fā)站寫一個(gè)哈夫曼的編譯碼系統(tǒng)?;疽螅唬?)從終端讀入字符集大小為n(即字符的個(gè)數(shù)),逐一輸入n個(gè)字符和相應(yīng)的n個(gè)權(quán) 值(即字符出現(xiàn)的頻度),建立哈夫曼樹,進(jìn)行編碼,最后輸出并存于文件hfmtree中。2)利用已建好的哈夫曼編碼文件hfmtree,對鍵盤輸入的正文進(jìn)行譯碼。輸出字符正(文,再輸出該文的二進(jìn)制碼。3)測試數(shù)據(jù)。((n=27)和頻度的實(shí)際統(tǒng)計(jì)數(shù)據(jù)建立哈夫曼樹。并實(shí)現(xiàn)以下報(bào)文的譯碼和輸出:“THISPROGRAMISMYFAVORITE”。2.思考題:利用哈夫曼樹及哈夫曼編碼的原理編寫一個(gè)算法,n個(gè)自然數(shù)之間經(jīng)過加 減運(yùn)算后結(jié)果最小的值是多少。注意:只能進(jìn)行加減運(yùn)算,且最后結(jié)果和運(yùn)算的中間結(jié)果不 能為負(fù)。二、實(shí)驗(yàn)指導(dǎo) include include include include typedefstruct unsignedint unsignedint {weight? parent,lchild,rchild?} HTNode,*HuffmanTree? typedefchar **HuffmanCode? typedefstruct{ unsignedint s1? unsignedint s2?} MinCode?MinCodeSelect(HuffmanTreeHT,unsignedintn)?HuffmanCodeHuffmanCoding(HuffmanTree*H1,unsignedint*w,char*ch,unsignedintn)//求哈夫曼樹及哈夫曼編碼,將哈夫曼編碼寫入文本文件 {— 1—教學(xué)過程及內(nèi)容unsignedinti,s1=0,s2=0? HuffmanTreep,HT? HuffmanCodeHC? char *cd? unsignedintf,c,start,m? MinCodemin? FILE*fp?if((fp=fopen(“”,“wt”))==NULL){ printf(“!”)? exit(1)? } if(nHT=(HuffmanTree)malloc((m+1)*sizeof(HTNode))? for(p=HT,i=0?iweight=*w?p173。parent=0? p173。lchild=0?p173。rchild=0? } for(?iweight=0?p173。parent=0? p173。lchild=0?p173。rchild=0?} for(i=n+1?iHT[s1].parent=i?HT[s2].parent=i? HT[i].lchild=s1?HT[i].rchild=s2?HT[i].weight=HT[s1].weight+HT[s2].weight?} HC=(HuffmanCode)malloc((n+1)*sizeof(char*))? cd=(char*)malloc(n*sizeof(char*))? cd[n173。1]=39。39。? for(i=1?iif(HT[f].lchild==c)cd[173。173。start]=39。039。?— 2—教學(xué)過程及內(nèi)容elsecd[173。173。start]=39。139。?HC[i]=(char*)malloc((n173。start)*sizeof(char))? strcpy(HC[i],amp。cd[start])? } free(cd)?for(i=1?i} MinCodeSelect(HuffmanTreeHT,unsignedintn)//求權(quán)值的最小值和次最小值 { unsignedintmin,secmin? unsignedinttemp? unsignedinti,s1,s2? MinCodecode? s1=1?s2=1?for(i=1?i} for(?is2=i? break?} for(i=1?i— 3—教學(xué)過程及內(nèi)容s2=i?} =s1? =s2? returncode?} voidTranscodeing(intn,char*Char_Code,char*Huffman_Code)//從文本文件中讀取哈夫曼編碼,并字符編碼轉(zhuǎn)為哈夫曼編碼 { FILE*fp?charstr[215],ch[50]={39。39。}? HuffmanCodeHC=NULL? inti=0,len,j,k?HC=(HuffmanCode)malloc((n+1)*sizeof(char*))? if((fp=fopen(“”,“rt”))==NULL){ printf(“!”)? exit(1)? } while(!feof(fp)){ memset(str,0,sizeof(str))? fgets(str,215,fp)? if(str[0]==0)break? len=strlen(str)? ch[i]=str[0]?HC[i]=(char*)malloc((len173。1)*sizeof(char*))? memcpy(HC[i],amp。str[1],len173。2)? HC[i][len173。2]=0? i++? } fclose(fp)? i=0?k=0?while(Char_Code[i]!=39。39。){ for(j=0?j— 4—教學(xué)過程及內(nèi)容free(HC)? } intmain(){ HuffmanTreeHT=NULL? HuffmanCodeHC=NULL? unsignedint*w=NULL,i,n?charch[50]={39。39。},Huffman_Code[1024]={39。39。}?charChar_Code[]=“THISPROGRAMISMYFAVORITE”? printf(“Inputn:n”)? scanf(“%d”,amp。n)?w=(unsignedint*)malloc((n+1)*sizeof(unsignedint))? w[0]=0?printf(“Enterweight,character:n”)? for(i=1?iTranscodeing(n,Char_Code,Huffman_Code)? printf(“%sn”,Huffman_Code)? free(w)? return0? }— 5— 授課進(jìn)度第14周,第26次課(2學(xué)時(shí))授課題目(教學(xué)章、節(jié)實(shí)驗(yàn)七圖的遍歷(Ⅰ)或主題)授課日期016年11月30日(11 2月29日).掌握圖常用的鄰接矩陣存儲存儲結(jié)構(gòu)。,即深度優(yōu)先遍歷和廣度優(yōu) 2 先遍歷。教學(xué) 目標(biāo)。教學(xué) 。重點(diǎn)。教學(xué) 難點(diǎn)請選擇你授課時(shí)所采用的教學(xué)方法(在括號中畫“√”):講授法﹝﹞,討論法﹝﹞,演示法﹝﹞,案例法﹝﹞,發(fā)現(xiàn)法﹝﹞,探究法﹝﹞,教學(xué)談話法﹝﹞,實(shí)驗(yàn)法﹝√﹞,參觀法﹝﹞,考察法﹝﹞,自學(xué)輔導(dǎo)法﹝﹞,練習(xí)方法法(習(xí)題或操作課)﹝√﹞,讀書指導(dǎo)法﹝﹞,聽說法﹝﹞,寫生法﹝﹞,視唱 法﹝﹞,工序法(技能課)﹝﹞,實(shí)習(xí)作業(yè)法﹝﹞,其他﹝﹞ 教學(xué)實(shí)物﹝﹞,多媒體﹝﹞,投影﹝﹞,影像﹝﹞,CAI課件﹝﹞,PPT﹝√﹞,標(biāo)本手段﹝﹞,掛圖﹝﹞,模型﹝﹞,其他﹝﹞ 討 論、思考 題、作業(yè)[ 1]李素若,陳萬華,:中國水利水電出版社,2014.[ 2]李素若,陳萬華,:中國水利水 請選擇你授課時(shí)所采用的教學(xué)手段(在括號中畫“√”):參考電出版社,教學(xué)過程及內(nèi)容一、實(shí)驗(yàn)內(nèi)容圖的鄰接矩陣存儲結(jié)構(gòu)如下:defineMaxVerNum100//設(shè)置鄰接矩陣的最大頂點(diǎn)數(shù) typedefcharVertexType?//設(shè)置圖的頂點(diǎn)信息為字符//設(shè)置邊上權(quán)值為整型 typedefintEdgeType?typedefstruct{ VertexTypevexs[MaxVerNum]?//圖的頂點(diǎn)信息表EdgeTypeedges[MaxVerNum][MaxVerNum]?//圖的鄰接矩陣//圖的頂點(diǎn)數(shù)和邊數(shù) intn,e?MGraph?//圖的鄰接矩陣表示結(jié)構(gòu)定義 } 1.鍵盤輸入數(shù)據(jù),建立一個(gè)圖的鄰接矩陣,并進(jìn)行圖的深度優(yōu)先遍歷和廣度優(yōu)先遍歷。二、實(shí)驗(yàn)指導(dǎo).參考代碼為: 1 include include defineMaxVerNum100//設(shè)置鄰接矩陣的最大頂點(diǎn)數(shù) typedefcharVertexType?//設(shè)置圖的頂點(diǎn)信息為整型//設(shè)置邊上權(quán)值為整型 typedefintEdgeType?typedefstruct{ VertexTypevexs[MaxVerNum]?//圖的頂點(diǎn)信息表EdgeTypeedges[MaxVerNum][MaxVerNum]?//圖的鄰接矩陣//圖的頂點(diǎn)數(shù)和邊數(shù) intn,e?MGraph?//圖的鄰接矩陣表示結(jié)構(gòu)定義 } typedefenum{FALSE,TRUE}boolean? booleanvisited[MaxVerNum]?//頂點(diǎn)訪問標(biāo)記向量 structlinkqueuenode { intdata? structlinkqueuenode*next? } ?typedefstruct { structlinkqueuenode*front? structlinkqueuenode*rear? linkque? } voidInitQueue(linkque*q){ structlinkqueuenode*p? p=(structlinkqueuenode*)malloc(sizeof(structlinkqueuenode))? p173。next=NULL?— 1—教學(xué)過程及內(nèi)容q173。front=p?q173。rear=p?} intQueueEmpty(linkqueq){ inti?if(==)i=1? elsei=0? return(i)? } voidEnQueue(linkque*q,intx){ structlinkqueuenode*p? p=
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1