数据结构课程设计(已完结)
| 目錄 ?報數問題 迷宮問題 ?拓撲排序 散列文件的插入、刪除和查找 二叉排序樹和二叉平衡樹: |
_____________________________________________________________________________
迷宮代碼出bug了我改了下只改了最終代碼了把迷宮上的走的路線改成了從2開始了
大家能看懂就好
?報數問題
其實就是約瑟夫環用但循環列表來實現
忽然發現我們學校的并不是約瑟夫環
題目如下:
9、報數問題
問題描述:有n個小朋友圍成一圈玩游戲,小朋友從1至n編號,2號小朋友坐在1號小朋友的順時針方向,3號小朋友坐在2號小朋友的順時針方向,……,1號小朋友坐在n號小朋友的順時針方向。
游戲開始,從1號小朋友開始順時針報數,接下來每個小朋友的報數是上一個小朋友報的數加1。若一個小朋友報的數為k的倍數或其末位數(即數的個位)為k,則該小朋友被淘汰出局,不再參加以后的報數。當游戲中只剩下一個小朋友時,該小朋友獲勝。
例如,當n=5, k=2時:
1號小朋友報數1;
2號小朋友報數2淘汰;
3號小朋友報數3;
4號小朋友報數4淘汰;
5號小朋友報數5;
1號小朋友報數6淘汰;
3號小朋友報數7;
5號小朋友報數8淘汰;
3號小朋友獲勝。
給定n和k,請問最后獲勝的小朋友編號為多少?
輸入格式
輸入一行,包括兩個整數n和k,意義如題目所述。
輸出格式
輸出一行,包含一個整數,表示獲勝的小朋友編號。
樣例輸入
5 2
樣例輸出
3
樣例輸入
7 3
樣例輸出
4
數據規模和約定
對于所有評測用例,1 ≤?n?≤ 1000,1 ≤?k?≤ 9。 要求:利用單向循環鏈表存儲結構模擬此過程。 #include <iostream> #include <stdio.h> using namespace std; int N, K; // 1<=N<=1000 1<=K<=9 typedef struct Node {int data;struct Node *next; } Node, *LNode; void creat_list(LNode &H) {LNode p, q;q = H;int i = 0;int x; //尾插法for (int i = 0; i < N; i++){p = new Node;p->data = i+1;p->next = NULL;q->next = p;q = p;}p->next = H; } void print_list(LNode &H) {LNode p = H->next;while (p != H){cout << p->data << " ";p = p->next;} } void win_put(LNode &H){int count=1,key=0;LNode p=H->next;LNode q=H;//count報數計數器while(N-key!=1){if(count%K==0||count%10==K){LNode del;del=p;p=p->next;q->next=p;free(del);key++;//人數計數器}else{p=p->next;q=q->next;}if(p==H){p=H->next;q=H;}count++;}cout<<p->data; } int main() {cin >> N >> K;LNode H;H = new Node;H->next = NULL;creat_list(H);//print_list(H);win_put(H); }迷宮問題
主要用一個二維數組來表現迷宮用棧來記錄路徑和存放路徑
?第一步結構體:
const int MAXLENGTH = 50; typedef int MazeType[MAXLENGTH][MAXLENGTH]; // 迷宮數組[行][列] MazeType m; //聲明一個全局迷宮對象m typedef struct //坐標 {int x;int y; } PosType; //坐標結構體 typedef struct {int ord; //通道塊在路徑上的“序號”PosType seat; //通道塊在迷宮中的“坐標位置”int di; //從從此通道塊走向下一通道塊的“方向” } SElemType; //棧的元素類型 typedef struct {SElemType *base; //棧底指針SElemType *top; //棧頂指針int stacksize; //棧的大小 } Stack; //用的是順序棧第二步是棧的一些函數:
| int ?InitStack(Stack &S) | // 構造一個空棧S |
| int Push(Stack &S, SElemType e) ? | ? //入棧 |
| int Pop(Stack &S, SElemType &e) | //出棧,移除當前棧頂元素 |
| int StackEmpty(Stack S) | //檢測是否為空棧 |
第三步輸出迷宮(0代表的是墻1代表的是通道).
void Print(int x, int y) // 輸出迷宮圖,0表示墻,1表示通路 {int i, j;for (i = 0; i < x; i++){for (j = 0; j < y; j++)printf("%3d", m[i][j]);printf("\n");} }第四步在迷宮移動時的一些函數?
| int Pass(PosType b) | 看看b點能否通過 |
| void FootPrint(PosType a) | 把他的序號變成足跡 |
| PosType NextPos(PosType c, int di) | 根據當前位置及移動方向返回下一位置 |
| void MarkPrint(PosType b) | 死點(就是怎么都不能走的點) |
| int MazePath(PosType start, PosType end) | 迷宮的從start怎么走到end的函數 |
第五步是主函數
int main() {int X, Y, i, j, n;cout << "輸入迷宮的行數,列數:" << endl;cin >> X >> Y;for (i = 0; i < Y; i++) // 定義上下邊的墻值為0{m[0][i] = 0; //第一行為0m[X - 1][i] = 0; //最后一行為0}for (j = 1; j < X - 1; j++) //左右兩邊列為0{m[j][0] = 0;m[j][Y - 1] = 0;}for (i = 1; i < X - 1; i++) //定義所有內墻值為1(即通路)for (j = 1; j < Y - 1; j++)m[i][j] = 1;cout << "請輸入迷宮的內墻數:" << endl;cin >> n;for (i = 0; i < n; i++){int x, y; //輸入內墻的坐標值,以左上角坐標為(1,1)計算cout << "輸入第" << i + 1 << "個墻的位置" << endl;cin >> x >> y;m[x][y] = 0;}PosType a, b;a.X = 1;a.Y = 1;b.X = 8;b.Y = 8;MazePath(a, b);Print(X, Y); }最終代碼:
#include <iostream> #include <stdio.h> #include <fstream> using namespace std; const int MAXLENGTH = 25; typedef int MazeType[MAXLENGTH][MAXLENGTH]; // 迷宮數組[行][列] const int MAXSIZE = 576; const int OK = 1; const int ERROR = 0; MazeType m; //聲明一個全局迷宮對象m int curstep = 2; //走的路徑長度 typedef struct //坐標 {int X;int Y; } PosType; //坐標結構體 typedef struct {int ord; //通道塊在路徑上的“序號”PosType seat; //通道塊在迷宮中的“坐標位置”int di; //從從此通道塊走向下一通道塊的“方向” } SElemType; //棧的元素類型 typedef struct {SElemType *base;SElemType *top;int stacksize; } Stack; int InitStack(Stack &S) // 構造一個空棧S {S.base = new SElemType[MAXSIZE];S.top = S.base;S.stacksize = MAXSIZE;return OK; }int Push(Stack &S, SElemType e) //入棧 {if (S.top - S.base == S.stacksize){return ERROR;}*(S.top)++ = e;return OK; }int Pop(Stack &S, SElemType &e) //出棧,移除當前棧頂元素 {if (S.top == S.base)return ERROR;e = *--S.top;return OK; }int StackEmpty(Stack S) //檢測是否為空棧 {if (S.top == S.base)return OK;elsereturn ERROR; } int Pass(PosType b) // 當迷宮m的b點的序號為1(可通過路徑) {if (m[b.X][b.Y] == 1)return OK;elsereturn ERROR; } void FootPrint(PosType &a) // 使迷宮m的a點的序號變為足跡(curstep) {m[a.X][a.Y] = curstep; } PosType NextPos(PosType c, int di) // 根據當前位置及移動方向,返回下一位置 {PosType dir[4] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; // {行增量,列增量}//方向依次為上右下左c.X += dir[di].X;c.Y += dir[di].Y;return c; } void MarkPrint(PosType b) {m[b.X][b.Y] = -1; // 使迷宮m的b點的序號變為-1(不能通過的路徑) } int MazePath(PosType start, PosType end) // 若迷宮maze中存在從入口start到出口end的通道,則求得一條存放在棧中(從棧底到棧頂) {Stack S;PosType curpos;SElemType e;InitStack(S);curpos = start; //把入口設置為當前位置do //應為棧一開始是空的所以 do while{if (Pass(curpos)){ // 當前位置可以通過,即是未曾走到過的通道塊FootPrint(curpos); // 留下足跡e.ord = curstep;e.seat.X = curpos.X;e.seat.Y = curpos.Y; //當前位置e.di = 0;Push(S, e); // 入棧當前位置及狀態curstep++; // 足跡加1if (curpos.X == end.X && curpos.Y == end.Y) // 到達終點(出口)return OK;curpos = NextPos(curpos, e.di); //將當前位置變為e.di方向上的臨近通道塊}else{ // 當前位置不能通過if (!StackEmpty(S)){Pop(S, e); // 退棧到前一位置curstep--; //走的路徑長度while (e.di == 3 && !StackEmpty(S)) // 前一位置處于最后一個方向(北),即當前位置的四周都無法通過{MarkPrint(e.seat); // 留下不能通過的標記(-1)Pop(S, e); // 退回一步curstep--;}if (e.di < 3) // 沒到最后一個方向(北){e.di++; // 換下一個方向探索Push(S, e);curstep++;curpos = NextPos(e.seat, e.di); // 設定當前位置是該新方向上的相鄰塊}}}} while (!StackEmpty(S));return ERROR; } void Print(int x, int y) // 輸出迷宮圖,0表示墻,1表示通路 {int i, j;for (i = 0; i < x; i++){for (j = 0; j < y; j++)printf("%3d", m[i][j]);printf("\n");} } #define readDataPath "C:\\Users\\yu\\Desktop\\MAze.txt" int main() {int X, Y, i, j, n;cin >> X >> Y;FILE *fp = fopen(readDataPath, "r"); //打開文件for (i = 0; i < X ;i++){for (j = 0; j < Y; j++){fscanf(fp, "%d", &m[i][j]); /*每次讀取一個數,fscanf函數遇到空格或者換行結束*/}fscanf(fp, "\n");}fclose(fp);PosType a, b;a.X = 1;a.Y = 1;b.X = 8;b.Y = 8;if (MazePath(a, b)){Print(X, Y);}else{cout << "No find" << endl;} }我把迷宮圖形保存到了文件里了
?拓撲排序
特別簡單不多作介紹了
利用有向圖鄰接表來實現
數據是:
?輸出結果是:v9 v10 v11 v6 v1 v4 v2 v3 v5 v7? v8 v12?
#include <iostream> #include <algorithm> #include <queue> #include<cstring> #include<stack> using namespace std; #define MAXN 105 typedef struct ArcNode{int adjvex;struct ArcNode *nextarc; }ArcNode; typedef struct VNode{int data;ArcNode *firstarc; }VNode,AdjList[MAXN]; typedef struct{AdjList Vertices;int vexnum,arcnum; }ALGraph; void Creat_UDG(ALGraph &G)//有向圖 {cin>>G.vexnum>>G.arcnum;for(int i=1;i<=G.vexnum;i++){cin>>G.Vertices[i].data;G.Vertices[i].firstarc=NULL;}for(int i=1;i<=G.arcnum;i++){ int x,y;cin>>x;cin>>y;ArcNode *p1=new ArcNode;ArcNode *p2=new ArcNode;p1->adjvex=y;p1->nextarc=G.Vertices[x].firstarc;//應為他是有向圖G.Vertices[x].firstarc=p1;} } int in[100],out[100]; void info(ALGraph G) {for(int i=1;i<=G.vexnum;i++){ArcNode *p=G.Vertices[i].firstarc;while(p){out[i]++;in[p->adjvex]++;p=p->nextarc;}} } int Topologicallsort(ALGraph G,int topo[]){stack<int >S;info(G);for(int i=1;i<=G.vexnum;i++){if(in[i]==0){S.push(i);//將入度為0的全部押入}}int m=0,i;while(!S.empty()){i=S.top();S.pop();topo[m]=i;m++;ArcNode *p=G.Vertices[i].firstarc;while(p){in[p->adjvex]--;if(in[p->adjvex]==0){S.push(p->adjvex);}p=p->nextarc;}}if(m<G.vexnum) {return 0;}else{return 1;}} int main() {ALGraph G;Creat_UDG(G);//創建了一個有向圖;int topo[G.vexnum+1];Topologicallsort(G,topo);for(int i=0;i<G.vexnum;i++){cout<<"v"<<topo[i]<<" ";} }散列文件的插入、刪除和查找
只是一個大致實現等我有空在慢慢優化
效果如圖:
#include <iostream> #include <stdio.h> using namespace std; const int MAXSIZE = 1e5 + 5; typedef struct FLNode {int data;struct FLNode *next; } FLNode; FILE *fp; FLNode HT[MAXSIZE]; //散列表文件 void Init() {if ((fp = fopen("hash.txt", "r")) == NULL) //讀散列主文件{cout << "Not find" << endl;}int key, h;for (int i = 0; i < 13; i++) //單鏈表的數量定為13{HT[i].next = NULL;}while (!feof(fp)){fscanf(fp, "%d ", &key);h = key % 13;FLNode *q = new FLNode;q->data = key;q->next = HT[h].next;HT[h].next = q;}fclose(fp);return; } void Insert(int &key) { //向散列文件中插入數據int h;h = key % 13;FLNode *q = new FLNode;q->data = key;q->next = HT[h].next;HT[h].next = q;if ((fp = fopen("hash.txt", "w")) == NULL) //重新覆蓋原有數據{cout << "not find" << endl;}for (int i = 0; i < 13; i++){FLNode *p = HT[i].next;while (p){fprintf(fp, "%d ", p->data); //寫入文件中去p = p->next;}fprintf(fp, "\n");}fclose(fp);return; } void Search(int key) {int h;h = key % 13;FLNode *p = HT[h].next;while (p){if (p->data == key){cout << "Succefully Find !" << key << endl;break;}p = p->next;}if (!p){cout << "Not Find" << key << endl;} } void Delete(int key) {int h;h = key % 13;FLNode *p, *q;p = &HT[h];q = HT[h].next;while (q){if (q->data == key){p->next = q->next;cout << "Succefully delete!" << endl;break;}p = p->next;q = q->next;}if (!q)cout << "Not find,can not delete" << endl;else{if ((fp = fopen("hash.txt", "w")) == NULL){cout << "not find" << endl;}for (int i = 0; i < 13; i++){FLNode *p = HT[i].next;while (p){fprintf(fp, "%d ", p->data);p = p->next;}fprintf(fp, "\n");}fclose(fp);}return; } int main() {int key;if ((fp = fopen("hash.txt", "w")) == NULL){cout << "not find" << endl;}cin >> key;while (key != 0){fprintf(fp, "%d ",key);cin >> key;}fclose(fp);Init();cout << "Insert data into hash file:" << endl;cin >> key;Insert(key);cout << "Remove element from hash file:" << endl;cin >> key;Delete(key);cout << "Find data from hash file:" << endl;cin >> key;Search(key); }二叉排序樹和二叉平衡樹:
編程實現二叉排序樹的創建、插入、刪除和查詢
編程實現二叉平衡樹的創建、插入、刪除和查詢
最后一個了做完就完事了感覺就是對基礎結構的理解更深了一點吧
?二叉排序樹:
//二叉排序樹的插入創建刪除和查詢 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; typedef struct BSTNOde {int data;struct BSTNOde *lchild, *rchild; } STNOde, *BSTree; //二叉排序樹的結構定義 FILE *fp; BSTree SearchBST(BSTree T, int &key) {//二叉排序樹中的查找if ((!T) || key == T->data){if(!T){cout<<"Not find"<<endl;}else{cout<<"Find"<<T->data<<endl;}return T;}else if (key < T->data){return (SearchBST(T->lchild, key));}else{return (SearchBST(T->rchild, key)); } }void Insert(BSTree &T, int &key) {if (!T) //當T是空的時候{BSTree s = new BSTNOde;s->data = key;s->lchild = s->rchild = NULL;T = s;}else if (key < T->data){Insert(T->lchild, key);}else{Insert(T->rchild, key);}// O(log2(n)) } //永遠插入的位置都是葉子 void CreatBST(BSTree &T) {fp = fopen("tree.txt", "r");T = NULL;int e;while (!feof(fp)){ //結束標志fscanf(fp, "%d", &e);Insert(T, e);}// O(n*log2(n)) } void DeleteBST(BSTree &T,int key) {BSTree p=T,f=NULL;while(p){if(p->data==key){break;}f=p;//f記錄的是p的雙親if(p->data>key){p=p->lchild;}if(p->data<=key){p=p->rchild;}}if(!p){cout<<"Not find!";return ;}BSTree q=p;//找到了那個被刪除的值并且把它付給pif(p->lchild&&p->rchild){//他的左右結點都存在時BSTree s=p->lchild;while(s->rchild){q=s;//r是s的雙親s=s->rchild;}p->data=s->data;//將s的值給p接下來只需要處理pif(q!=p){//就是s雙親不是p的時侯q->rchild=s->lchild; }else{q->lchild=s->lchild;}delete s;return ;}else if(!p->lchild){p=p->rchild;}else if(!p->rchild){p=p->lchild;}if(!f){T=p;}else if(q==f->lchild){f->lchild=p;}else{f->rchild=p;}delete q; } void Print(BSTree T) { //中序遍歷if (!T){return;}Print(T->lchild);cout << T->data << " ";Print(T->rchild); } int main() {BSTree T;CreatBST(T);int x, y, z;Print(T); //中序遍歷得到一個有序的序列cout <<endl<< "Please enter a value to insert"<<endl;cin >> x;Insert(T, x);Print(T); //中序遍歷得到一個有序的序列cout<<endl << "Please enter a value to find:"<<endl;cin >> y;SearchBST(T, y);cout <<endl<< "Please enter a value to delete:"<<endl;cin >> z;DeleteBST(T, z); }二叉平衡樹:
#include <bits/stdc++.h> #define LH 1 //左高 #define EH 0 //等高 #define RH -1 //右高 //二叉平衡樹 using namespace std; int a[105]; typedef struct BTnode {int data;int bf;BTnode *lchild, *rchild; } BTnode, *BTtree;int Depth(BTtree T) {if (!T)return 0;else{int m = Depth(T->lchild);int n = Depth(T->rchild);if (m > n){return m + 1;}else{return n + 1;}} }void R_Rotate(BTtree *T) //右旋 {BTtree L;L = (*T)->lchild;(*T)->lchild = L->rchild;L->rchild = (*T);*T = L; } void L_Rotate(BTtree *T) //左旋 {BTtree R;R = (*T)->rchild;(*T)->rchild = R->lchild;R->lchild = (*T);*T = R; }void LeftBalance(BTtree *T)/左平衡 {BTtree L, Lr;L = (*T)->lchild;switch (L->bf){case LH: // LL(*T)->bf = L->bf = EH;R_Rotate(T);break;case RH: // LRLr = L->rchild;switch (Lr->bf){case LH: //左高(*T)->bf = RH;L->bf = EH;break;case EH: //平衡(*T)->bf = L->bf = EH;break;case RH: //右高(*T)->bf = EH;L->bf = LH;break;}Lr->bf = EH;L_Rotate(&(*T)->lchild); //左子樹左旋處理R_Rotate(T); //右旋處理break;case EH: //特殊情況4,這種情況在添加時不可能出現,只在移除時可能出現,旋轉之后整體樹高不變L->bf = RH;(*T)->bf = LH;R_Rotate(T);break;} } void RightBalance(BTtree *T)//右平衡 {BTtree R, Rl;R = (*T)->rchild;switch (R->bf){case RH: // RR(*T)->bf = R->bf = EH;L_Rotate(T);break;case LH: // RLRl = R->lchild;switch (Rl->bf){case LH:(*T)->bf = EH;R->bf = RH;break;case EH:(*T)->bf = R->bf = EH;break;case RH:(*T)->bf = LH;R->bf = EH;break;}Rl->bf = EH;R_Rotate(&(*T)->rchild); //右子樹右旋處理L_Rotate(T); //左旋break;case EH: //特殊情況4,這種情況在添加時不可能出現,只在移除時可能出現,旋轉之后整體樹高不變R->bf = LH;(*T)->bf = RH;L_Rotate(T);break;} }BTtree creatBTtree() {BTtree bt = NULL;return bt; }void InOrderTraverseBTtree(BTtree T) //中序遍歷 {if (T){InOrderTraverseBTtree(T->lchild);printf("(%d,%d) ", T->bf, T->data);InOrderTraverseBTtree(T->rchild);}else{return;} }int InsertAVL(BTtree *T, int e, int *tall) //插入函數 {if (!*T){*T = new BTnode;(*T)->data = e;(*T)->lchild = (*T)->rchild = NULL;(*T)->bf = EH;*tall = 1;}else{if (e == (*T)->data){*tall = 0;return 0;}else if (e < (*T)->data) //左子樹中尋找{if (!InsertAVL(&(*T)->lchild, e, tall)){return 0;}if (*tall){switch ((*T)->bf){case LH: // llLeftBalance(T);*tall = 0;break;case EH:(*T)->bf = LH;*tall = 1;break;case RH:(*T)->bf = EH;*tall = 0;break;}}}else //右子樹中尋找{if (!InsertAVL(&(*T)->rchild, e, tall)){return 0;}if (*tall){switch ((*T)->bf){case LH:(*T)->bf = EH;*tall = 0;break;case EH:(*T)->bf = RH;*tall = 1;break;case RH:RightBalance(T);*tall = 0;break;}}}}return 1; } int SearchBST(BTtree T, int e, BTtree *f, BTtree *p) //尋找元素是否存在 // T為當前根節點,e為要查找的元素,f為T的父節點,p為找到的元素節點或沒找到時的根節點 {if (!T) //若樹空{*p = *f;return 0;}else if (T->data == e) //若找到該元素{*p = T;return 1;}else if (e < T->data) //如果該元素比根節點值小return SearchBST(T->lchild, e, &T, p);else //如果該元素比根節點值大return SearchBST(T->rchild, e, &T, p); }int deleteAVL(BTtree &t, BTtree *f, int e, int *shorter) {if (t == NULL){return 0;}else if (t->data == e){BTtree q = NULL;if (t->lchild == NULL) //左子樹為空{q = t;t = t->rchild;free(q);*shorter = 1;}else if (t->rchild == NULL) //右子樹為空{q = t;t = t->lchild;free(q);*shorter = 1;}else //左右子樹都存在{BTtree s = t;q = t->lchild;while (q->rchild){s = q;q = q->rchild;}t->data = q->data;deleteAVL(t->lchild, &t, q->data, shorter); //在左子樹中遞歸刪除前驅結點}}else if (e < t->data) //左子樹中繼續查找{if (!deleteAVL(t->lchild, &t, e, shorter)){return 0;}if (*shorter){switch (t->bf){case LH: //若原來LH,刪除左節點,狀態變為EHt->bf = EH;*shorter = 1;break;case EH: //若原來平衡,刪除左節點,狀態變為RHt->bf = RH;*shorter = 0;break;case RH:if (t->rchild->bf == EH)*shorter = 0;else*shorter = 1; //若為此情況,樹高減一RightBalance(&t); //右平衡處理break;}}}else //右子樹中繼續查找{if (!deleteAVL(t->rchild, &t, e, shorter)){return 0;}if (*shorter){switch (t->bf){case LH:if (t->lchild->bf == EH) //若為此情況,樹高減一*shorter = 0;else*shorter = 1;LeftBalance(&t); //左平衡處理break;case EH: //若原來平衡,刪除右節點,狀態變為LHt->bf = LH;*shorter = 0;break;case RH: //若原來RH,刪除右節點,狀態變為EHt->bf = EH;*shorter = 1;break;}}}return 1; }int main() {BTtree T, p, f;T = creatBTtree();int x, n;int tall, shorter;n = 0;printf("請輸入你要創建二叉平衡樹的數字,輸入0表示結束輸入:");while (~scanf("%d", &x)){if (!x)break;a[++n] = x;}for (int i = 1; i <= n; i++){InsertAVL(&T, a[i], &tall);}printf("中序遍歷該二叉平衡樹的結果為:");InOrderTraverseBTtree(T);printf("\n");int num;printf("請輸入你要插入的數字:");cin >> num;InsertAVL(&T, num, &tall);printf("插入該數字后中序遍歷該二叉排序樹的結果為:");InOrderTraverseBTtree(T);printf("\n");int xx, y;printf("請輸入你要查詢的數字:");cin >> xx;f = NULL;if (SearchBST(T, xx, &f, &p)){printf("該數存在\n");}else{printf("該數不存在\n");}printf("請輸入你要刪除的數字:");cin >> y;f = NULL;if (!SearchBST(T, y, &f, &p)){printf("該數不存在,無法進行刪除操作!\n");}else{deleteAVL(T, &f, y, &shorter);printf("進行刪除操作后中序遍歷該二叉排序樹的結果為:");InOrderTraverseBTtree(T);}printf("平衡二叉樹的深度:%d", Depth(T));printf("\n");return 0; } /* 1 5 4 2 6 8 7 9 11 14 13 12 16 19 0 */總結
以上是生活随笔為你收集整理的数据结构课程设计(已完结)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端学习(2812):前端小程序学习之小
- 下一篇: HDU 2549 壮志难酬