
数据结构
文章平均质量分 71
kewing
这个作者很懒,什么都没留下…
展开
-
归并排序
比较了weiss的代码和严蔚敏的代码,觉得二者不分伯仲呐……不过weiss的代码更容易以C实现…… #include #include #define MAXLEN 100#define LQ(a,b) ((a)<=(b))typedef int ElemType;void Merge(ElemType A[],ElemType Temp[],int left,原创 2009-08-10 10:31:00 · 410 阅读 · 0 评论 -
希尔排序
希尔排序,基于严本 #include "stdio.h"#include "conio.h"#include "ctype.h"#include "stdlib.h"#define MAXSIZE 100#define LT(a,b) ((a)<(b))typedef int keytype; //以整数作为排序对象typedef char* infotyp原创 2009-08-10 10:35:00 · 424 阅读 · 0 评论 -
快速排序--weiss版
以下是依据weiss版写出的快排算法,其中MARK处是自认为很精彩的地方…… #include #define MAXSIZE 100#define CutOff (3)typedef int elemtype;void Swap(elemtype *,elemtype *);void InsertSort(elemtype *,int);elemtype原创 2009-08-12 10:39:00 · 530 阅读 · 0 评论 -
2-路排序
2-路排序代码: #include #define MAXSIZE 100typedef int elemtype;void BiInsertsort(elemtype buffer[],int length){ elemtype tmp[MAXSIZE+1]; int first,final,med; int i,j; tmp[1]=buffer[1]原创 2009-08-12 15:59:00 · 392 阅读 · 0 评论 -
改进的双向冒泡排序
#include #include #include #define MAXSIZE 100#define TRUE 1#define FALSE 0typedef int elemtype;void BubbleSort(elemtype *,int);void swap(elemtype *,elemtype *);void main(){原创 2009-08-14 11:32:00 · 502 阅读 · 0 评论 -
基于快速排序的快速选择
#include #include #include #define MAXSIZE 100#define CUTOFF 3//#define SELECTNUM 24 //当要求选特定的第K个时,可使用#definetypedef int elemtype;void Swap(elemtype *,elemtype *);void InsertSort(e原创 2009-08-15 10:44:00 · 495 阅读 · 0 评论 -
优先队列
#include #include #include #include "fatal.h"#include "BinHeap.h"#define MAXELEMENTS 1000#define MinPQsize 100#define MinData 0 //起哨兵的作用#ifndef _BinHeap_Hstruct HeapStruct;type原创 2009-08-18 09:46:00 · 582 阅读 · 0 评论 -
迷宫问题--第一次写的一个算是大点的程序吧……用了接近一天……
先使用栈,求处任意一条路径,再使用队列,求出最短路径。代码长了点,而且由于个人水平原因,质量不是很好……但以目前我的水平也就这样了……以后得道成仙以后再写更好的代码……#include #include #include #define FALSE 0#define TRUE 1#define MAXSIZE 1000 //最大的行数void MGPathest(int原创 2009-08-21 16:44:00 · 4287 阅读 · 0 评论