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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)課程設(shè)計報告-在線瀏覽

2025-05-10 08:49本頁面
  

【正文】 rch(const string x,BSTNode *ptr)。 bool Insert(const TeleNumberamp。ptr)。ptr)。//插入到二叉搜索樹bool BST::Insert(const TeleNumberamp。ptr){ int i=0。 if (ptr==NULL) { cerrOut of spaceendl。 return true。 } else if (int((i,i+1)[0])int(ptr(i,i+1)[0])) { Insert(e1,ptrright)。}。ptr){ BSTNode *temp。 } else if (int((0,1)[0])int(ptr(0,1)[0])) { Remove(x,ptrright)。amp。 while (templeft!=NULL) { temp=templeft。 Remove(ptr,ptrright)。 if (ptrleft==NULL) { ptr=ptrright。 delete temp。 } } return false。//在二叉搜索樹的某個值BSTNode *BST::Search(const string x,BSTNode *ptr){ if (ptr==NULL) { return NULL。 } else if (int((0,1)[0])int(ptr(0,1)[0])) { return Search(x,ptrright)。 }。ptr){ ptr=Search(x,root)。 return true。include include int main(int argc, char* argv[]){ int a。 BST bst。 cout************************歡迎使用個人電話號碼查詢系統(tǒng)**********************endl。 cout************************|| ||**********************endl。 cout************************|| ||**********************endl。 int i=0。 while(!()) { finTele[i]。 i++。 while (a!=5) { cout請輸入您的選擇:。 switch(a) { case 1: { cout請輸入你要查找的名字:。 if((str,())==NULL) cout沒有此聯(lián)系人!endl。 }break。 cinTele[i]。 }break。 cinstr。 }break。 cinstr。 }break。 }break。}【運行結(jié)果】實習(xí)題目三 排序應(yīng)用【問題描述】假定文本文件 中是我校所有參加南望山莊二期挑房職工的信息,請編寫程序,讀出文件中的內(nèi)容,中。職稱編號: 校級干部 0教授、正處級 1副教授、副處級 2講師、科級 3其他 4【設(shè)計思想】 先將文本文檔的內(nèi)容讀到數(shù)組中,重載輸入輸出號,使得文本文檔中的每一行為一個元素,然后按照要用冒泡排序法。struct staff。operator(istream amp。c)。operator(ostream amp。c)。struct staff //結(jié)構(gòu)體包括職工信息{ string name。 //職稱編號 string workingage。 //年齡 friend istream amp。is,staff amp。 //重載, friend ostream amp。is,staff amp。}sta[max]。operator(istream amp。c){ is。 }ostream amp。os,staff amp。 return os。in。j=i。v[j1]=v[j]。 } if (atof(v[j1].())==atoi(v[j].())) { if (atof(v[j1].())atoi(v[j].())) { staff temp=v[j1]。v[j]=temp。v[j1]=v[j]。 } } } } }}include include include include iostreaminclude fstreaminclude using namespace std。 ifstream fin()。 i++。 BubbleSort(sta,i)。ji。 } ofstream fon()。ji。 } ()。}【運行結(jié)果】實習(xí)題目四 “火燒連營”問題【問題描述】“火燒連營”是三國演義中的著名典故之一廣為流傳, 是火燒連營中的軍營分布圖,每個字符A 代表一個營帳,營帳是可燃物,其他字符代表不可燃的空白地段,文件共有40 行70 列,請你編寫程序,讀入該文件的內(nèi)容,再從鍵盤輸入任意點的x 和y值(x70,y40)作為著火點,“火燒連營”后,被燃燒的營帳標(biāo)上字符’X’, 中。若是著火點,則從此位置開始上下左右尋找其相鄰點,判斷其是否為著火點?!驹O(shè)計表示】輸入點的坐標(biāo)坐標(biāo)的值為A時,將此A變成X,并判斷上下左右的值,若為A,將此點壓棧,并判斷棧是否為空當(dāng)x39或y69重新輸入,重新輸入否,則循環(huán)否,退頂端的元素 【代碼表示】//結(jié)構(gòu)體表示點struct items //結(jié)構(gòu)體x為某點的x坐標(biāo)值,y為某點的y坐標(biāo)值{ int x,y。SeqStackitems st(40*70)。X39。A39。=y1。 } if (str[x][y+1]==39。) { =x。 (temp)。A39。=y。 } if (str[x+1][y]==39。) { =x+1。 (temp)。 path(str,)。int main(int argc, char* argv[]){ char str[40][70]。 ()。i40。j70。 } } ()。i40。j70。 } coutendl。 cout請輸入著火點:。 while (str[x][y]==39。) { cout您輸入的信息不對,請重新輸入:。 } path(str,x,y)。i40。j70。 } coutendl。 // for(i=0。i++) { for(int j=0。j++) { fonstr[i][j]。 } ()。}【運行結(jié)果】實習(xí)題目五 管道鋪設(shè)施工的最佳方案選擇【問題描述】需要在某個城市的n 個居民區(qū)之間鋪設(shè)煤氣管道,則在這n 個居民區(qū)之間只要鋪設(shè)n1條管道即可。選擇最有的施工方案能使總投資盡可能少,這個問題即為求網(wǎng)的“最小生成樹”?!驹O(shè)計思想】可選用Kruskal 算法或Prim 算法來求網(wǎng)的最小生成樹,無論哪一個算法都要選好恰當(dāng)?shù)妮o助數(shù)據(jù)結(jié)構(gòu),以存放邊或頂點的集合?!敬a實現(xiàn)】//鄰接矩陣的實現(xiàn)class Graphmtx{ public: Graphmtx(int sz=30,int max=300)。 delete []Edge。 return i=0amp。i=numVertices?VerticesList[i]:NULL。amp。 } int NumberOfEdges(){return numEdges。} int getFirstNeighbor (int v)。 bool insertVertex (const intamp。 bool insertEdge (int v1, int v2, int cost)。 bool removeEdge (int v1, int v2)。 inumVertices。 } return 1。 int numEdges。 int *VerticesList。 const int maxWeight。Graphmtx::Graphmtx(int sz, int max):maxWeight(max){ maxVertices=sz。 numEdges=0。 VerticesList = new int[maxVertices]。 for (i = 0。 i++) Edge[i] = new int[maxVertices]。 i maxVertices。 j maxVertices。 }bool Graphmtx::insertVertex(const intamp。 } VerticesList[numVertices++]=vertex。}。amp。amp。amp。amp。 numEdges++。 } else return false。int Graphmtx::getFirstNeighbor (int v) { if (v != 1) { for (int col = 0。col++) if (Edge[v][col] amp。 Edge[v][col]maxWeight) return col。}int Graphmtx::getNextNeighbor (int v, int w) { if (v != 1 amp。 w != 1) { for (int col = w+1。 col++) if (Edge[v][col] amp。 Edge[v][col] maxWeight) return col。}include iostreamusing namespace std。ostream amp。os,MinSpanTree amp。struct MSTEdgeNode{ int tail,head。 MSTEdgeNode():tail(0),head(0),key(0){} bool operator=(MSTEdgeNodeamp。 } bool operator(MSTE
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1