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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)五報(bào)告(已修改)

2024-11-13 18:01 本頁面
 

【正文】 第一篇:數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)五報(bào)告實(shí)驗(yàn)五報(bào)告課程名稱: 數(shù)據(jù)結(jié)構(gòu) 實(shí)驗(yàn)名稱:二叉樹的創(chuàng)建與遍歷實(shí)驗(yàn)日期2011/11/16一、實(shí)驗(yàn)?zāi)康模和ㄟ^上機(jī)實(shí)驗(yàn)進(jìn)一步掌握棧、隊(duì)列、二叉樹的存儲(chǔ)結(jié)構(gòu)及基本操作的實(shí)現(xiàn)方法。二、實(shí)驗(yàn)內(nèi)容與要求:基于二叉鏈表存儲(chǔ)結(jié)構(gòu)實(shí)現(xiàn)二叉樹的基本運(yùn)算,要求:⑴能建立非空二叉樹;⑵實(shí)現(xiàn)二叉樹的先、中、后序遞歸遍歷算法;⑶實(shí)現(xiàn)二叉樹的非遞歸的先(或中、或后)序遍歷算法及層序遍歷算法;⑷記錄運(yùn)行結(jié)果并對(duì)遞歸算法和非遞歸算法的效率加以分析。三、算法設(shè)計(jì) 結(jié)構(gòu)體的定義:typedef struct BiTNote{struct Node{}。類的定義: class CStack{//棧 private:}。class LinkQueue{ //隊(duì)列 public: BiTree base。BiTree top。int stacksize。//當(dāng)前空間分配量 static const int STACK_INIT_SIZE=100。static const int STACKINCREMENT=10。CStack()。void Push(BiTree T)。//入棧 void Pop(BiTree amp。T)。//出棧 bool StackEmpty()。//判斷是否是空棧 friend class CBiTree。Node(BiTree amp。d):num(d),next(NULL){} BiTree num。Node *next。char data。struct BiTNote *lchild,*rchild。}BiTNote,*BiTree。public:}。LinkQueue()。bool QueueEmpty()。void EnQueue(BiTree amp。T)。void DeQueue(BiTree amp。T)。friend class CBiTree。int length。//隊(duì)列元素的個(gè)數(shù) Node *front。//隊(duì)列的頭指針 Node *rear。//隊(duì)列的尾指針 private: class CBiTree{ public:}。CStack::CStack():stacksize(STACK_INIT_SIZE){ //構(gòu)造函數(shù),初始化} void CStack::Push(BiTree T){...} //入棧 void CStack::Pop(BiTree amp。T){...} //出棧 bool CStack::StackEmpty(){} int i=0。//全局變量int CBiTree::CreatBiTree(BiTree amp。T){}//構(gòu)造二叉樹 //LinkQueue類函數(shù)的實(shí)現(xiàn) LinkQueue::LinkQueue(){} bool LinkQueue::QueueEmpty(){} void LinkQueue::EnQueue(BiTree amp。T){} void LinkQueue::DeQueue(BiTree amp。T){} int CBiTree::PreOrderTraverse1(BiTree T, int(*Visit)(char)){...} //前序遍歷(遞歸)int CBiTree::InOrderTraverse(BiTree T, int(*Visit)(char)){...} //中序遍歷(遞歸)int CBiTree::PostOrderTraverse(BiTree T, int(*Visit)(char)){...}//后序遍歷(遞歸)int CBiTree::PreOrderTraverse2(BiTree T, int(*Visit)(char)){ //前序遍歷(非遞歸)BiTree p=T。while(p!=NULL||!()){ BiTree p=(BiTree)malloc(STACK_INIT_SIZE*sizeof(BiTNote))。base=p。top=base。int CreatBiTree(BiTree amp。T)。//建立二叉樹int PreOrderTraverse1(BiTree T,int(*Visit)(char e))。//前序遍歷(遞歸)int PreOrderTraverse2(BiTree T,int(*Visit)(char e))。//前序遍歷(非遞歸)int InOrderTraverse(BiTree T,int(*Visit)(char e))。//中序遍歷(遞歸)int PostOrderTraverse(BiTree T,int(*Visit)(char e))。//后序遍歷(遞歸)int LevelOrderTraverse(BiTree T,int(*Visit)(char e))。//層序遍歷(非遞歸)CStack s。LinkQueue link。private:}} while(p!=NULL){} if(!()){} (p)。p=prchild。Visit(pdata)。(p)。p=plchild。return 1。int CBiTree::LevelOrderTraverse(BiTree T, int(*Visit)(char))//層序遍歷(非遞歸){} // include“” include“” include int PrintData(char e){}int main(){CBiTree Tree。BiTree T。T=(BiTree)malloc(sizeof(BiTNote))。cout(T)。while(!()){} return 0。BiTree p。(p)。Visit(pdata)。(plchild)。(prchild)。} cout四、測試結(jié)果五、心得體會(huì)這次實(shí)驗(yàn)嘗試用C++寫,好長時(shí)間沒接觸了,所以寫的比較吃力,在寫的過程中溫習(xí)了C++的一些知識(shí),但代碼寫的很亂,沒有用模板,C++的引用也忘了等。這次還發(fā)現(xiàn)自己對(duì)指針還是不熟練(一個(gè)指針賦值的小錯(cuò)誤多花了好多時(shí)間才找到)。總之覺得自己的編程水平很有待提高。第二篇:數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)二報(bào)告數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)二報(bào)告——簡單計(jì)算器姓名:王稀賓 班 級(jí):06
點(diǎn)擊復(fù)制文檔內(nèi)容
數(shù)學(xué)相關(guān)推薦
文庫吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1