三少爷

专注~~~

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年3月27日

摘要: #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 阅读全文
posted @ 2012-03-27 20:24 三少_爷 阅读(168) 评论(0) 推荐(0) 编辑

摘要: #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; 阅读全文
posted @ 2012-03-27 20:22 三少_爷 阅读(125) 评论(0) 推荐(0) 编辑