#include <stdio.h>
#define NULL 0
#define MAX_VERTEX_NUM 6
#define OK 1
int Visited[MAX_VERTEX_NUM];
typedef char vextype;
typedef float adjtype;
typedef struct
{ vextype vexs[MAX_VERTEX_NUM];
adjtype arcs[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
int vexnum,arcnum;
}MGraph;
struct close...
- [游客] 好东西,收藏之 05/26 23:40
- [游客] 有机会也搞搞 07/23 11:06
- [游客] 看不懂咧。 12/10 20:33
- [游客] 范式?好像是数据库原理吧。 12/10 20:30
- [游客] 顶! 12/07 15:14
- [游客] 分析的很正确啊。 12/07 15:11
- [gyk1983] 加油 12/06 16:37
- [wdm] 是这么回事。以前我也遇见过,不过,重新启动就没事了。 应该是再重启后这个键值就应高over了吧。 03/22 14:15
- [wdm] 蛤蟆跳井--扑通(不懂) 03/21 14:31
- [xiaofkg] 通用的 03/21 08:41
- [huibian] 建议增加些注释 ;-) 01/04 10:38
- [xiaofkg] 继续,成功就在脚下。 01/03 19:14
- [xiaofkg] 坚持做好所能做好的一切,加油,加油.... 10/19 16:56
[2008-01-03 19:16] 最小生成树算法源码
阅读全文 |
评论次数(1) |
浏览次数(353) |
所属类型(数据结构题目解答)
[2008-01-03 19:11] 插入排序算法
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf("%d"...
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf("%d"...
阅读全文 |
评论次数(2) |
浏览次数(311) |
所属类型(数据结构题目解答)
[2008-01-03 19:11] 希尔排序源码
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
void shellinsert(sqlist *l,int dk)
{int i,j;
for(i=dk+1;i<=l->length;++i)
{if(LT(l->r[i].key,l->r[i-dk]...
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
void shellinsert(sqlist *l,int dk)
{int i,j;
for(i=dk+1;i<=l->length;++i)
{if(LT(l->r[i].key,l->r[i-dk]...
阅读全文 |
评论次数(2) |
浏览次数(307) |
所属类型(数据结构题目解答)
[2008-01-03 19:10] 快速排序源码
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
int partition(sqlist *l,int low,int high)
{int pivotkey;
l->r[0]=l->r[low];
pivotkey=l->r[low].key;
whi...
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
int partition(sqlist *l,int low,int high)
{int pivotkey;
l->r[0]=l->r[low];
pivotkey=l->r[low].key;
whi...
阅读全文 |
评论次数(0) |
浏览次数(293) |
所属类型(数据结构题目解答)
[2008-01-03 19:09] 简单排序算法源码
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[20];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf...
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[20];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf...
阅读全文 |
评论次数(0) |
浏览次数(296) |
所属类型(数据结构题目解答)
[2008-01-03 19:08] 树形选择排序算法源码
#include <limits.h>
#include <stdlib.h>
#include <math.h>
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
void treesort(sqlist *ll)
{int i...
#include <stdlib.h>
#include <math.h>
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
void treesort(sqlist *ll)
{int i...
阅读全文 |
评论次数(0) |
浏览次数(332) |
所属类型(数据结构题目解答)
[2008-01-03 19:07] 堆排序源码
#define LT(a,b) ((a)<(b))
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf(...
#define MAX 20
typedef char *other;
typedef struct
{int key;
other info[6];
}redtype;
typedef struct
{redtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the number of what you create the list(<20)\n");
scanf(...
阅读全文 |
评论次数(0) |
浏览次数(295) |
所属类型(数据结构题目解答)
[2008-01-03 19:07] 二路归并算法排序
#define LQ(a,b) ((a)<=(b))
#define LT(a,b) ((a)<(b))
#define MAX 20
#include <stdlib.h>
typedef char *other;
typedef struct
{int key;
other info[6];
}rcdtype;
typedef struct
{rcdtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the numb...
#define LT(a,b) ((a)<(b))
#define MAX 20
#include <stdlib.h>
typedef char *other;
typedef struct
{int key;
other info[6];
}rcdtype;
typedef struct
{rcdtype r[MAX+1];
int length;
}sqlist;
createlist(sqlist *L)
{int n,i;
printf("input the numb...
阅读全文 |
评论次数(0) |
浏览次数(291) |
所属类型(数据结构题目解答)
[2008-01-03 19:05] 弗洛伊德算法源码
#include <stdio.h>
#include <limits.h>
#define MAX_VERTEX_NUM 6
#define OK 1
int Visited[MAX_VERTEX_NUM];
typedef char vextype;
typedef int adjtype;
typedef int PM[MAX_VERTEX_NUM][MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef int DM[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct
{ vextype vexs...
#include <limits.h>
#define MAX_VERTEX_NUM 6
#define OK 1
int Visited[MAX_VERTEX_NUM];
typedef char vextype;
typedef int adjtype;
typedef int PM[MAX_VERTEX_NUM][MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef int DM[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct
{ vextype vexs...
阅读全文 |
评论次数(1) |
浏览次数(297) |
所属类型(数据结构题目解答)
[2007-12-24 20:51] 图中包含的其他文件的函数
void insertvex(MGraph *ga)
{int i;
printf("please input the vex:\n");
ga->vexs[ga->vexnum]=getch();
for(i=0;i<ga->vexnum;i++)
ga->arcs[ga->vexnum][i]=ga->arcs[i][ga->vexnum]=0;
ga->vexnum++;
}
void insertarc(MGraph *ga)
{int i,j;
char v1,v2;
float weight;
fflush(stdin); ...
{int i;
printf("please input the vex:\n");
ga->vexs[ga->vexnum]=getch();
for(i=0;i<ga->vexnum;i++)
ga->arcs[ga->vexnum][i]=ga->arcs[i][ga->vexnum]=0;
ga->vexnum++;
}
void insertarc(MGraph *ga)
{int i,j;
char v1,v2;
float weight;
fflush(stdin); ...
阅读全文 |
评论次数(0) |
浏览次数(317) |
所属类型(数据结构题目解答)