- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 BFS中使用到的queue.h
typedef struct Node{ int data; struct Node *next;}Node;typedef struct { Node *front;//队首指针 Node *rear;//队尾指针}Queue;Queue * EnQueue(Queue *queue,int e){//向队尾插入一个结点 Node *newptr;//指向新结点的指针 newptr=ma
2008-01-26 18:02:00
428
原创 BFS广度优先遍历算法
/*图的广度优先遍历算法author:wuzuquanlast modify:2008-1-8*/#include #include #include "queue.h"//specify the queue structure #define VNUM 8 //定义顶点的个数#define MAX ((VNUM)*(VNUM))#define WHITE 0#define GRAY 1#de
2008-01-26 18:00:00
566
原创 C语言实现堆栈(栈)的数据结构
#include #include #include #define elemtype intstruct Node{ elemtype data; struct Node *next;};struct stack{ struct Node *top;//栈顶指针};elemtype getTop(struct stack *s){//返回栈顶指针元素 if(s->top==NULL) p
2008-01-25 14:12:00
954
1
原创 min_heapsort.h
/*最小优先级队列的实现,为了算法描述方便,数组下标从1开始,下标为0的元素舍弃不用author:wuzuquanlast_modify:2008-1-11*/#include #include #define PARENT(i) ((i)>>1)#define LEFT(i) ((i)#define RIGHT(i) ((LEFT(i))+1)void swap(int *x, int *y
2008-01-25 14:09:00
340
原创 prim algorithm
/*prim algorithmauthor:wuzuquanlast_modify:2008-1-10*/#include#include#include "min_heapsort.h"#define VNUM 9#define NIL 100extern int heap_size;extern int length=VNUM;typedef struct{ int v; int w;}
2008-01-25 14:07:00
447
原创 dijkstra算法
/*dijkstra algorithmauthor:wuzuquanlast_modify:2008-1-12*/#include #include #define MAX_DIST 10000#define NIL 10000#define VNUM 5#define PARENT(i) ((i)>>1)#define LEFT(i) ((i)#define RIGHT(i) ((LEFT
2008-01-12 12:54:00
429
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人