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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)實驗報告冊合集(存儲版)

2024-10-20 03:48上一頁面

下一頁面
  

【正文】 。intInsertBST(BiTreeamp。} BiTreeCreateBST(int a[],int n){//創(chuàng)建二叉樹函數(shù) BiTreebst=NULL。T=(T)lChild。}(T)data=sdata。else{if(keydata)returnDeleteBST(TlChild,key)。} void printtree(BiTreeT,intnlayer){//打印二叉樹 if(T==NULL)return。intnum=0。} void InOrderNoRec(BiTree root)//中序非遞歸遍歷 { BiTree p=root。p=prChild。}p=stack[num1]。printf(“n”)。int *arr=(int*)malloc(num*sizeof(int))。printf(“樹狀圖為:n”)。printf(“n”)。printf(“插入成功!”)。printf(“刪除成功!”)。printf(“先序遍歷:n”)。break。//返回值類型 //定義二叉樹結(jié)構(gòu) typedefstructBiTNode{ SlemType name。Tname=name。class student{ private: intnum。}。if(i==j){ coutj。ptr[k].set(q,w,e,r)。}}ptr[m].show()。遞歸遍歷的實現(xiàn)比非遞歸的遍歷真的簡單很多。typedef struct { RedType r[100]。//子表的第一個記錄作基準對象int pivotkey = [low].key。//尋找基準QuickSort(L, low, pivotloc1)。Llastlast++)cinLdata[Llast]。high=i1。//插入 } return 0。j{cout}coutcout}if(m==2){Sequenlist *L。cout四、重要函數(shù)功能說明Sequenlist *Sqlset()輸入要折半插入排序的一組元素int Partition(SqList amp。修改程序前兩個運行結(jié)果截圖(兩個程序,調(diào)試運行兩次,每次只能進行一次排序)快速排序程序運行結(jié)果截圖:折半插入排序程序結(jié)果截圖:程序重要模塊修改截圖:修改程序后運行截圖:(一個程序,調(diào)試運行一次,可多次進行不同序列的不同排序)。i++){coutdata[i]}coutcoutgoto gg。} coutQuickSort(L,1,)。j){ Ldata[j]=Ldata[j1]。i++){Ldata[0]=Ldata[i]。coutcini。}void QuickSort(SqList amp。//2 折半插入排序的結(jié)構(gòu)體int Partition(SqList amp。include “”typedef struct { int key。樹狀圖形輸出還是不美觀,還需要改進。ptr[m]=ptr[n]。coute。} void student::show(){ coutint main(){ coutnumlock。void show()。} elsereturn 0。T,intno,intscore,string name){//插入二叉樹函數(shù)if(T==NULL){T =(BiTree)malloc(sizeof(BiTNode))。//數(shù)據(jù)類型 typedefstring SlemType。printf(“樹狀圖為:n”)。break。K)。T)。){ loop: printf(“n”)。printf(“n”)。num)。} } printf(“n”)。while(NULL!=p||num0){while(NULL!=p){stack[num++]=p。p=stack[num]。p=prChild。} void PreOrderNoRec(BiTree root)//先序非遞歸遍歷 { BiTree p=root。return max+1。T,int key){ if(!T)return 0。while(srChild){q=s。T){BiTreeq,s。} else if(keyTdata){InsertBST(TrChild,key)。structBiTNode *lChild, *rChild。Anext=qb。qanext=Anext。qanext=Anext。// 保存pa的前驅(qū)指針 // 保存pb的前驅(qū)指針 pa=panext。j三.// 將合并逆置后的結(jié)果放在C表中,并刪除B表Status ListMergeOppose_L(LinkList amp?!緦嶒灲Y(jié)果】[實驗數(shù)據(jù)、結(jié)果、遇到的問題及解決]一. Status InsertOrderList(SqList amp。template int BiTree::i=0。coutcoutLevelOrder(root)。int hr= Depth(rootrchild)。}else{if((rootlchild==NULL)amp。int front = 0, rear = 0。else {InOrder(rootlchild)。}}void Release(BiNode *root){if(root!=NULL){Release(rootlchild)。cinch。(4)編寫求二叉樹高度的函數(shù)(5)編寫一主函數(shù)來驗證算法實現(xiàn) 第一題源代碼:include using namespace std。i++){coutcoutcoutreturn 0。i++){cin [i].row。pb++。=。T item。j {k = i *(i + 1)/ 2 + j。i n。cin n。(2)實現(xiàn)矩陣轉(zhuǎn)置算法。k = ()。return x。} /***************************************/ template T LinkQueue::DeQueue(){ Node *p。snext=NULL。//隊頭隊尾指針 public: LinkQueue()。} T DeQueue(){if(rear==front)throw “下溢”。int front, rear。coutint j=0。LinkStack bb。Node *p。} bool Empty(){top==NULL?return 1:return 0。public: LinkStack(){top=NULL。} template T SeqStack::pop(){ T x。}~SeqStack(){}void push(T x)。三、實驗內(nèi)容:。cout(1)。coutdata)int r[ ]={10,9,8,7,6,5,4,3,2,1}。pnext=qnext。jp=pnext。pnext=s。amp。for(int i=0。while(pamp。//在單鏈表中第i個位置插入元素值x的節(jié)點T Delete(int i)。while(p){Node *q。firstnext=NULL。Node *next。} void PrintList(){for(int i=0。} ~SeqList()//析構(gòu)函數(shù)為空{(diào)}int Length()//求線性表的長度{return length。三、實驗內(nèi)容:1.設(shè)計一個靜態(tài)數(shù)組存儲結(jié)構(gòu)的順序表類,要求編程實現(xiàn)如下任務(wù):建立一個線性表,首先依次輸人數(shù)據(jù)元素1,2,3,…,10,然后刪除數(shù)據(jù)元素6,最后依次顯示當前線性表中的數(shù)據(jù)元素。提交實驗報告,報告內(nèi)容包括:目的、要求、算法描述、程序結(jié)構(gòu)、主要變量說明、程序清單、調(diào)試情況、設(shè)計技巧、心得體會。length=n。return x。templatestruct Node { T data。first=new Node。}~LinkList(){Node *p=first。//求單鏈表值為x的元素序號void Insert(int i,T x)。j=1。p=first。while(pamp。snext=pnext。amp。x=qdata。ip=pnext。cout()。提交實驗報告,報告內(nèi)容包括:目的、要求、算法描述、程序結(jié)構(gòu)、主要變量說明、程序清單、調(diào)試情況、設(shè)計技巧、心得體會。public:SeqStack(){top=1。data[top]=x。template class LinkStack { private: Node *top。T gettop(){if(top!=NULL)return topdata。} template T LinkStack::pop(){ T x。}/******************************************************/ void main(){ SeqStack aa。i(i)。/********************
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1