原创 順序表求集合交併——C++實現
#include<iostream> #include<malloc.h> #define MAXSIZE 100//順序表長度上限 using namespace std; typedef int DataType; typedef
原创 單鏈表求集合交併
#include<iostream> #include<malloc.h> using namespace std; typedef int DataType; /*定義鏈表數據結構*/ typedef struct node{ D
原创 二叉樹-非遞歸遍歷(先、中、後)
#include<iostream> #include<malloc.h> #include<stdio.h> #define MAXSIZE 20 //最多結點個數 using namespace std; /*二叉鏈表*/ t
原创 二叉樹-遍歷
#include<iostream> #include<malloc.h> #include<stdio.h> #define MAXSIZE 20 //最多結點個數 using namespace std; /*二叉鏈表*/ t
原创 二叉樹-層序遍歷
#include<iostream> #include<malloc.h> #include<stdio.h> #define MAXSIZE 20 //最多結點個數 using namespace std; /*二叉鏈表*/ t
原创 單鏈表的基本操作——C++實現
#include<iostream> #include<malloc.h> using namespace std; typedef int DataType; /*定義鏈表數據結構*/ typedef struct node{ D
原创 順序棧——C++實現
#include<iostream> #include<malloc.h> #define MAXSIZE 50 using namespace std; typedef int DataType; typedef struct{ D
原创 單鏈表的逆置
#include<iostream> #include<malloc.h> using namespace std; typedef int DataType; /*定義鏈表數據結構*/ typedef struct node{ D
原创 二叉樹-遞歸遍歷(先、中、後)
#include<iostream> #include<malloc.h> #include<stdio.h> #define MAXSIZE 20 //最多結點個數 using namespace std; /*二叉鏈表*/ t
原创 迷宮問題(遞歸)
#include<iostream> #include<iomanip> #define k 4 //試探方向個數 #define m 6 //迷宮的實際行 #define n 8 //迷宮的實際列 using namespace
原创 數制轉換問題(順序棧)
#include<iostream> #include<malloc.h> using namespace std; #define MAXSIZE 50 typedef int DataType; typedef struct{ Da
原创 約瑟夫環問題(順序表)——C++實現
#include<iostream> #include<malloc.h> #define MAXSIZE 100//人數上限 using namespace std; typedef int DataType; typedef str
原创 循環隊列(順序隊列)
#include<iostream> #include<malloc.h> #define MAXSIZE 50 using namespace std; typedef int DataType; typedef struct{
原创 迷宮問題(順序棧)
#include<iostream> #include<malloc.h> #define MAXSIZE 50 #define k 4 //四個方向 #define m 6 //迷宮的實際行 #define n 8 //迷宮的實際
原创 後綴表達式求值(順序棧)
#include<iostream> #include<malloc.h> #define MAXSIZE 50 using namespace std; typedef int DataType; typedef struct{ D