随笔分类 -  数据结构

摘要:#include using namespace std;#define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define OVERFLOW -2#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1typedef int ElemType;typedef int status;//线性表结构typedef struct{ ElemType *elem; int length; int listsize;}SqList;//初始... 阅读全文
posted @ 2013-07-11 10:54 2011winseu 阅读(200) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #define MAX_VERTEX_NUM 20 5 #define OK 1 6 #define ERROR 0 7 #define MAX 1000 8 using namespace std; 9 typedef struct Arcell 10 { 11 double adj; 12 }Arcell,AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM]; 13 typedef struct 14 { 15 char vexs[MAX_VERTEX_N... 阅读全文
posted @ 2013-06-15 19:12 2011winseu 阅读(4808) 评论(0) 推荐(0)
摘要:1 #include 2 using namespace std; 3 struct TreeNode //树结构体定义 4 { 5 char data; 6 TreeNode *lchild,*rchild; 7 }; 8 char getonech(char ar[]) 9 { static int i; 10 return ar[i++]; 11 } 12 void CreateBiTree(TreeNode *&p,char ar[]) //建立一个新树 13 { 14 char ch; 15 ... 阅读全文
posted @ 2013-06-12 15:48 2011winseu 阅读(875) 评论(0) 推荐(0)