`
jaychang
  • 浏览: 718038 次
  • 性别: Icon_minigender_1
  • 来自: 嘉兴
社区版块
存档分类
最新评论
文章列表
/***************************** title : 拓扑排序(邻接矩阵实现) author: jay chang date : 2009/07/14 *****************************/ #include<iostream> using namespace std; #define MAXSIZE 99 #define FALSE 0 #define TRUE 1 typedef char VertexData; typedef int AdjType; typ ...
/*************************************** title:普利姆算法求连通图最小生成树 author: jay chang date: 2009.7.12 ****************************************/ #include<iostream> using namespace std; #define MAX 9999 #define MAXSIZE 99 #define FALSE 0 ...
#include<iostream> using namespace std; #define MAX_VERTEX_NUM 50 //定义最大的结点数 typedef enum{DG,UDG}GraphKind; //定义图的种类DG(有向图) UDG(无向图) typedef char VertexData; //定义结点信息的数据类型 ...
#include<iostream> using namespace std; #define MAX_VERTEX_NUM 50 //定义最大的结点数 typedef enum{DG,UDG}GraphKind; //定义图的种类DG(有向图) UDG(无向图) typedef char VertexData; //定义结点信息的数据类型 ...
#include<iostream> #define MAX_VERTEX_NUM 50 using namespace std; //定义顶点信息数据类型 typedef char VertexData; //定义图的种类 typedef enum{DG,UDG} GraphKind; //定义弧结点 typedef struct ArcNode { int tailvex,headvex; //定义弧结点的弧头,弧尾在图中的位置 ArcNode *tlink,*hlink; }ArcNode; //定义顶点 typedef str ...
#include<iostream> using namespace std; #define MAX_VERTEX_NUM 50 typedef char VertexData; //定义弧结点 typedef struct EdgeNode { int adjvex; //该弧指向顶点的位置 VertexData data; EdgeNode *next; }EdgeNode; //定义表头结点 typedef struct VetexNode { VertexData data; EdgeNode *l ...
#include<stdio.h> #include<stdlib.h> //#include<string.h> #include<iostream> using namespace std; typedef struct Node{ char ch; Node * prior; Node * next; }Node,* Linklist; //构建循环双链表 Node * createRoteLinklist() { Linklist L=(Node *)malloc(sizeof(Node ...
#include<stdlib.h> #include<iostream> using namespace std; typedef struct Node{ char ch; Node * next; Node * prior; }Node,* Bottom,* Top; //创建栈 Node * createStack() { char str;//int len=0; Bottom bottom=(Node *)malloc(sizeof(Node)); Top top=bottom; cin> ...
/********************* title: 一元多项式相加 author: jay chang date: 2009.4.12 ******************** #include<stdlib.h> #include<iostream> using namespace std; typedef struct poly{ int coef; int exp; poly * next; }poly,* Head; in ...
#include<stdio.h> #include<iostream> using namespace std; #define FALSE -1 typedef struct Node{ int data; Node *next; }Node,*Stack; Stack top=(Node *)malloc(sizeof(Node)); void InitialStack() { top->next=NULL; } bool IsEmpty() { bool flag; top-&g ...
#include<stdlib.h> #include<string.h> #include<iostream> using namespace std; #define FALSE 1 typedef struct StackNode{ char op; StackNode * next; }StackNode,*StackTop; char operation[50];int length; //链式栈栈顶 StackTop top=(StackNode *)malloc(sizeof(StackNode) ...
#include<iostream> #include<stdlib.h> #define TRUE 1 #define FALSE 0 using namespace std; typedef struct LinkQueueNode{ char data; LinkQueueNode *next; }LinkQueueNode; typedef struct LinkQueue{ LinkQueueNode *front; LinkQueueNode *rear; int length; int l ...
#include<stdlib.h> #include<iostream> #define TRUE 1 #define FALSE 0 using namespace std; typedef struct LinkQueueNode{ char data; LinkQueueNode *next; }LinkQueueNode; typedef struct CycQueue{ LinkQueueNode *front; LinkQueueNode *rear; int maxLength; int c ...
#include<iostream> using namespace std; typedef struct BiTreeNode{ char data; BiTreeNode *lChild; BiTreeNode *rChild; }BiTreeNode; //递归建立二叉树 void InitialBiTree(BiTreeNode *&node) { char data; cout<<"请输入数据,输入#结束"<<endl; cin>>data; ...
#include<iostream> using namespace std; typedef struct BiTreeNode{ char data; BiTreeNode *lChild; BiTreeNode *rChild; }BiTreeNode; int leafCount; //递归建立二叉树 void InitialBiTree(BiTreeNode *&node) { char data; cout<<"请输入数据,输入#结束"<<endl; cin>>dat ...
Global site tag (gtag.js) - Google Analytics