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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)報(bào)告冊(cè)合集(更新版)

  

【正文】 last。了解各種方法的排序過(guò)程及其依據(jù)的原則,并掌握各種排序方法的時(shí)間復(fù)雜度的分析方法。所以數(shù)據(jù)量越大的時(shí)候,二叉樹(shù)的查找效率越高。nif(ptr[m].average()student a。} coutq。ob2=d。intara。} else if(nono){ InsertBST(TlChild,no,score,name)。//左右子樹(shù)域 }BiTNode, *BiTree。} return 0。printf(“后序遍歷:n”)。case 3: layer=PosttreeDepth(bst)。case 2:}printf(“輸入要?jiǎng)h除的節(jié)點(diǎn)”)。switch(j){case 1:printf(“輸入要插入的節(jié)點(diǎn):”)。int K。printf(“n”)。printf(“輸入節(jié)點(diǎn)個(gè)數(shù):”)。p=NULL。intnum=0。p=plChild。}num。} printf(“%dn”,Tdata)。hr=PosttreeDepth(TrChild)。} } return 1。}else{ q=T。} returnbst。return 1。//數(shù)據(jù)類(lèi)型 typedefint Status。pb=pbnext。qa=pa。pb){} while(pa){} qa=pa。qa=pa。if(||)return INFEASIBLE。對(duì)線性表表示的集合,集合數(shù)據(jù)由用戶從鍵盤(pán)輸入(數(shù)據(jù)類(lèi)型為整型),建立相應(yīng)的順序表,且使得數(shù)據(jù)按從小到大的順序存放,將兩個(gè)集合的并的結(jié)果存儲(chǔ)在一個(gè)新的線性表集合中,并輸出?!?。coutcoutInOrder(root)。}}}int Depth(BiNode *root)//算法求二叉樹(shù)的深度{if(root==NULL)return 0。if(qrchild!=NULL)Q[++rear]=qrchild。coutdata)。PreOrder(rootrchild)。Creat(rootlchild)。void Creat(BiNode *amp。(2)實(shí)現(xiàn)二叉樹(shù)層次遍歷的非遞歸算法。for(i = 0。//puts()與 cout 一樣for(i = 0。[pb].col= [pa].row。B){ =。const int MaxTerm=100。i n。a[j][i] = a[i][j]。int main(){ int n,i,j。三、實(shí)驗(yàn)內(nèi)容:*n階的對(duì)稱(chēng)矩陣。} for(i = 1。if(pnext==NULL)rear=front。rearnext=s。/***************************************/ template LinkQueue::LinkQueue(){ Node *s。}。int i=(front+1)% QueueSize。const int QueueSize=100。}coutfor(i=1。return x。top=s。T pop()。}。top++。int top。掌握特殊線性表的常見(jiàn)算法。(3,0)。for(int i=0。q=pnext。while(pamp。sdata=x。j=0。} /***********************************/ template int LinkList::Locate(T x){ Node *p。p=firstnext。//取單鏈表第i個(gè)節(jié)點(diǎn)元素值int Locate(T x)。}length=n。}LinkList(T a[],int n)//建立n個(gè)節(jié)點(diǎn)的指針{Node *s。第二題源代碼: include using namespace std。length。idata[i]=a[i]。掌握線性表的常見(jiàn)算法。要求采用順序表實(shí)現(xiàn),假設(shè)該順序表的數(shù)據(jù)元素個(gè)數(shù)在最壞情況下不會(huì)超過(guò)10個(gè)。}T Get(int i)//按位查找,取線性表的第i個(gè)元素{ } int Locate(T x)//按值查找,求線性表中值為x的元素序號(hào){ } void Insert(int i, T x)//在線性表中第i個(gè)位置插入值為x的元素{ } T Delete(int i){if(length==0)throw“下溢”。icout”。}。//初始化一個(gè)空鏈表for(int i=0。q=p。//在單鏈表中刪除第i個(gè)節(jié)點(diǎn)void PrintList()。amp。ip=pnext。jp=pnext。} length++。j++。delete q。LinkList a(r , 10)。(1)。要求:設(shè)計(jì)一個(gè)主函數(shù)實(shí)現(xiàn)對(duì)順序堆棧類(lèi)和鏈?zhǔn)蕉褩n?lèi)代碼進(jìn)行測(cè)試。T pop()。if(top==1)throw “下溢”。} ~LinkStack(){while(top){Node *p。} }。if(top==NULL)throw “下溢”。for(int i=1。j=()。CirQueue(){front=rear=0。front=(front+1)% QueueSize。~LinkQueue(){ } void EnQueue(T x)。//創(chuàng)建頭結(jié)點(diǎn)s front=rear=s。T x。} /***********************************************/ void main(){ CirQueue a。j=()。(3)實(shí)現(xiàn)魔方陣算法。for(i = 0。i++){for(j = 0。save[k] = a[i][j]。}。if(0){int pb = 0。} } } int main(){ int i。cin [i].col。} 運(yùn)行結(jié)果:心得體會(huì):實(shí)驗(yàn)四 樹(shù)和二叉樹(shù)實(shí)驗(yàn)類(lèi)型:驗(yàn)證性 實(shí)驗(yàn)要求:必修 實(shí)驗(yàn)學(xué)時(shí): 2學(xué)時(shí)一、實(shí)驗(yàn)?zāi)康模簠⒄战o定的二叉樹(shù)類(lèi)的程序樣例,驗(yàn)證給出的有關(guān)二叉樹(shù)的常見(jiàn)算法,并實(shí)現(xiàn)有關(guān)的操作。template struct BiNode { T data。if(ch==39。Release(rootrchild)。coutdata)。//中序遍歷二叉樹(shù)//后序遍歷二叉樹(shù)//采用順序隊(duì)列,并假定不會(huì)發(fā)生上溢if(root==NULL)return。amp。if(hlhr)return hl+1。coutcoutshowleaf(root)。void main(){ cout AA。va,ElemType x){}二. Status DeleteK(SqList amp。A,LinkList amp。pb=pbnext。Anext=qa。//將當(dāng)前最小結(jié)點(diǎn)插入A表表頭 Anext=qa。順序表就是把線性表的元素存儲(chǔ)在數(shù)組中,元素之間的關(guān)系直接通過(guò)相鄰元素的位置來(lái)表達(dá)。//左右子樹(shù)域 }BiTNode, *BiTree。} elsereturn 0。} if(!(T)rChild){ //右子樹(shù)為空重接它的左子樹(shù)q=T。s=srChild。else{if(key==(T)data)return Delete(T)。} elsereturn 0。BiTreestack[50]。} printf(“n”)。printf(“%d ”,pdata)。p=plChild。}int main(){//主函數(shù)printf(“二叉排序樹(shù)的實(shí)現(xiàn)”)。printf(“依次輸入這些整數(shù)(要不相等)”)。layer=PosttreeDepth(bst)。printf(“***********************按提示輸入操作符************************:”)。InsertBST(bst,T)。DeleteBST(bst,K)。case 4:printf(“非遞歸遍歷二叉樹(shù)”)。printtree(bst,layer)。typedefint Status。Tno=no。} 其他含參函數(shù)也類(lèi)似 即可完成50個(gè)信息存儲(chǔ)用數(shù)組存儲(chǔ)50個(gè)信息,查看以往代碼include include using namespace std。int average()。switch(numlock){ case 0: couti。coutr。ptr[n]=a。一開(kāi)始打算用棧實(shí)現(xiàn)非遞歸,但是根據(jù)書(shū)里面的偽代碼發(fā)現(xiàn)部分是在C++編譯器里運(yùn)行不了的(即使補(bǔ)充了頭文件和數(shù)據(jù)的定義),所以之后參考了網(wǎng)上的數(shù)組非遞歸,發(fā)現(xiàn)其功能和棧相似。}RedType。L, int low, int high)//1 尋找基準(zhǔn){[0]=[low]。L, int low, int high)//1 快速排序 { //在序列l(wèi)owhigh中遞歸地進(jìn)行快速排序if(low high){int pivotloc= Partition(L, low, high)。coutcoutif(i0){for(Llast=1。low=1。} //后移Ldata[high+1]=Ldata[0]。for(int j=1。}if(m==3){exi
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1