BubbleSort
来源:互联网 发布:花生壳 免费 域名 流量 编辑:程序博客网 时间:2024/06/08 23:33
#include<stdio.h>
#define MAXE 20
typedef int KeyType;
typedef char InfoType[10];
typedef struct{
KeyType key;
InfoType data;
}RecType;
void BubblePass(RecType R[],int n){
int i,j,k;
RecType w;
for(i=0;i<n-1;i++)
{
for(j=n-1;j>i;j--)
{
if(R[j].key<R[j-1].key)
{
w=R[j];
R[j]=R[j-1];
R[j-1]=w;
}
}
printf("冒泡结果为:");
for(k=0;k<n;k++)
printf("%3d",R[k].key);
printf("\n");
}
}
#define MAXE 20
typedef int KeyType;
typedef char InfoType[10];
typedef struct{
KeyType key;
InfoType data;
}RecType;
void BubblePass(RecType R[],int n){
int i,j,k;
RecType w;
for(i=0;i<n-1;i++)
{
for(j=n-1;j>i;j--)
{
if(R[j].key<R[j-1].key)
{
w=R[j];
R[j]=R[j-1];
R[j-1]=w;
}
}
printf("冒泡结果为:");
for(k=0;k<n;k++)
printf("%3d",R[k].key);
printf("\n");
}
}
0 0
- BubbleSort
- BubbleSort
- BubbleSort
- bubblesort
- Bubblesort
- BubbleSort
- BubbleSort
- bubblesort
- bubblesort
- bubbleSort
- BubbleSort
- BubbleSort
- BubbleSort
- bubbleSort
- bubbleSort
- BubbleSort
- BubbleSort
- BubbleSort
- codeforces-441B-Valera and Fruits【暴力】
- 关于平方和立方和,注意范围的取值顺序
- sicily 1125. Arnie versus the IRS
- ios swift UILabel 颜色使用图片
- Job任务的3种实现:java.util.Timer, spring Quartz,spring @scheduled
- BubbleSort
- 606第九周周六赛 G - Calling Extraterrestrial Intelligence Again找最大的两个质数
- Bayer图像的由来及Opencv preview
- create table of mysql database
- Procedure -- 存储过程初体验
- 拖拽表格单元格,改变单元格内容
- 天声人語 20151112 くるくる変わる就活時期
- 修饰符全解
- java监听器的学习与应用