摘要:
#include <stdio.h>#include <stdlib.h>#define SUCCESS 1#define UNSUCCESS 0#define DUPLICATE -1#define NULLKEY -1#define OK 1#define EQ(x,y) ((x) = (y))#define LT(x,y) ((x) < (y))#define LE(x,y) ((x) <= (y))int hashSize[] = { 997,1999,11999};typedef struct{ int key; int data;}ElemTyp 阅读全文
摘要:
#include<stdio.h>#include<stdlib.h>void bubbleSort(int * data,int n){ int i,j,k; for(i=0;i < n-1;i++) //n datas only need n-1 times sort; { for(j = 0; j < n-i-1;j++) //compare times of each sort is n-i-1; { if(data[j]>data[j+1]) { k = data[j]; data[j] = data[j+1]; data[j+1] = k; 阅读全文