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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)報告冊合集-wenkub

2024-10-20 03 本頁面
 

【正文】 。delete top。template class LinkStack { private: Node *top。return x。data[top]=x。}bool Empty(){top=1?(return 1):(return 0)。public:SeqStack(){top=1。第一題源代碼: include using namespace std。提交實(shí)驗(yàn)報告,報告內(nèi)容包括:目的、要求、算法描述、程序結(jié)構(gòu)、主要變量說明、程序清單、調(diào)試情況、設(shè)計(jì)技巧、心得體會。cout()。cout()。cout(1,2)。ip=pnext。return x。x=qdata。else {Node *q。amp。int j。snext=pnext。} if(!p)throw“位置”。while(pamp。} } /***********************************/ template void LinkList::Insert(int i,T x){ Node *p。p=first。j++。j=1。/********************************/ template int LinkList::Length(){ return length。//求單鏈表值為x的元素序號void Insert(int i,T x)。delete q。}~LinkList(){Node *p=first。sdata=a[i]。first=new Node。//單鏈表頭指針int length。templatestruct Node { T data。SeqList theseqlist(a,n)。return x。x=data[i1]。length=n。template //定義模板類SeqList class SeqList { private: int length,x,j,data[10]。提交實(shí)驗(yàn)報告,報告內(nèi)容包括:目的、要求、算法描述、程序結(jié)構(gòu)、主要變量說明、程序清單、調(diào)試情況、設(shè)計(jì)技巧、心得體會。第一篇:數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)報告冊實(shí)驗(yàn)一 線性表的操作實(shí)驗(yàn)類型:驗(yàn)證性 實(shí)驗(yàn)要求:必修 實(shí)驗(yàn)學(xué)時: 2學(xué)時一、實(shí)驗(yàn)?zāi)康模簠⒄战o定的線性表順序表類和鏈表類的程序樣例,驗(yàn)證給出的線性表的常見算法。三、實(shí)驗(yàn)內(nèi)容:1.設(shè)計(jì)一個靜態(tài)數(shù)組存儲結(jié)構(gòu)的順序表類,要求編程實(shí)現(xiàn)如下任務(wù):建立一個線性表,首先依次輸人數(shù)據(jù)元素1,2,3,…,10,然后刪除數(shù)據(jù)元素6,最后依次顯示當(dāng)前線性表中的數(shù)據(jù)元素。public: public: SeqList()//無參構(gòu)造函數(shù){length=0。} ~SeqList()//析構(gòu)函數(shù)為空{(diào)}int Length()//求線性表的長度{return length。for(j=i。} void PrintList(){for(int i=0。coutcout//刪除線性表的第i個元素//注意此處j已經(jīng)是元素所在的數(shù)組下標(biāo) //遍歷線性表,按序號依次輸出各元素2.設(shè)計(jì)一個帶頭結(jié)點(diǎn)的單鏈表類,要求:(1)帶頭結(jié)點(diǎn)單鏈表類的成員函數(shù)包括取數(shù)據(jù)元素個數(shù)、插入元素、刪除所有值為k的元素、取數(shù)據(jù)元素。Node *next。public:LinkList(){first=new Node。firstnext=NULL。snext=firstnext。while(p){Node *q。}}int Length()。//在單鏈表中第i個位置插入元素值x的節(jié)點(diǎn)T Delete(int i)。} /******************************/ template T LinkList::Get(int i){ int j。while(pamp。} if(!p)throw “位置”。for(int i=0。int j。amp。else {Node *s。pnext=s。p=first。jp=pnext。q=new Node。pnext=qnext。}} /*******************************************/ template void LinkList::PrintList()// 遍歷單鏈表,按序號依次輸出個元素 { Node *p。coutdata)int r[ ]={10,9,8,7,6,5,4,3,2,1}。//執(zhí)行插入操作。cout(1)。coutcoutcoutcout//查找鏈表中第 5 個元素cout心得體會:實(shí)驗(yàn)二 棧、隊(duì)列、串的操作實(shí)驗(yàn)類型:驗(yàn)證性 實(shí)驗(yàn)要求:必修 實(shí)驗(yàn)學(xué)時: 2學(xué)時一、實(shí)驗(yàn)?zāi)康模簠⒄战o定的棧類和隊(duì)列類的程序樣例,驗(yàn)證給出的棧和隊(duì)列的常見算法,并結(jié)合線性表類實(shí)現(xiàn)有關(guān)串的操作。三、實(shí)驗(yàn)內(nèi)容:。/********************************************************/ const int StackSize=10。}~SeqStack(){}void push(T x)。} }。} template T SeqStack::pop(){ T x。}/****************************************************/ template struct Node { T data。public: LinkStack(){top=NULL。top=p。} bool Empty(){top==NULL?return 1:return 0。//沒有申請空間時 會出現(xiàn)錯誤!sdata=x。Node *p。top=topnext。LinkStack bb。k=()。coutint j=0。要求::依次把 1,2,3,4,5入隊(duì),然后出隊(duì)中的數(shù)據(jù)元素并在屏幕上顯示。int front, rear。data[rear]=x。} T DeQueue(){if(rear==front)throw “下溢”。/*********************************************/ template struct Node { T data。//隊(duì)頭隊(duì)尾指針 public: LinkQueue()。//取對頭元素} bool Empty()//判斷鏈隊(duì)列是否為空{(diào)front==rear?return 1:return 0。snext=NULL。sdata=x。} /***************************************/ template T LinkQueue::DeQueue(){ Node *p。x=pdata。return x。i (i)。k = ()。掌握它們的常見算法。(2)實(shí)現(xiàn)矩陣轉(zhuǎn)置算法。int a[10][10]。cin n。j n。i n。int k = 0。j {k = i *(i + 1)/ 2 + j。i n *(n + 1)/ 2。T item。}。=。pa 。pb++。cin 。i++){cin [i].row。puts(“輸出三元表237。i++){coutcoutcoutreturn 0。提交實(shí)驗(yàn)報告,報告內(nèi)容包括:目的、要求、算法描述、程序結(jié)構(gòu)、主要變量說明、程序清單、調(diào)試情況、設(shè)計(jì)技巧、心得體會。(4)編寫求二叉樹高度的函數(shù)(5)編寫一主函數(shù)來驗(yàn)證算法實(shí)現(xiàn) 第一題源代碼:include using namespace std。template class BiTree { private:static int i。cinch。else{root=new BiNode。}}void Release(BiNode *root){if(root!=NULL){Release(rootlchild)。else {coutdata。else {InOrder(rootlchild)。else {InOrder(rootlchild)。int front = 0, rear = 0。coutdata。}else{if((rootlchild==NULL)amp。}else{showleaf(rootlchild)。int hr= Depth(rootrchild)。}BiTree(BiNode *root){ } ~BiTree(){Release(root)。coutcoutLevelOrder(root)。”。template int BiTree::i=0。實(shí)驗(yàn)內(nèi)容:一、編寫程序?qū)崿F(xiàn)順序表的各種基本運(yùn)算,并在此基礎(chǔ)上設(shè)計(jì)一個主程序完成如下功能:(1)初始化順序表L;(2)依次在L尾部插入元素1,21,13,24,8;(3)輸出順序表L;(4)輸出順序表L長度;(5)判斷順序表L是否為空;(6)輸出順序表L的第3個元素;(7)輸出元素24的位置;(8)在L的第4個元素前插入元素0;
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1