汇编网首页登录博客注册
xiaofkg的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
好友圈
文章收藏
友情链接

[2008-01-03 19:16] 最小生成树算法源码

#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...
阅读全文 | 评论次数(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"...
阅读全文 | 评论次数(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]...
阅读全文 | 评论次数(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...
阅读全文 | 评论次数(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...
阅读全文 | 评论次数(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...
阅读全文 | 评论次数(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(...
阅读全文 | 评论次数(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...
阅读全文 | 评论次数(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...
阅读全文 | 评论次数(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); ...
阅读全文 | 评论次数(0) | 浏览次数(317) | 所属类型(数据结构题目解答)
页码数(2):  1  2