void BubbleSort(int *a,int n)

// BubbleSort.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

void swap(int& a,int& b)
{
	if(&a==&b)
		return;
	int tmp=a;
	a=b;
	b=tmp;
}

void BubbleSort(int *a,int n)
{
	int i,j;
	int flag;
	for(i=0;ii;j--)
		{
			if(a[j]

你可能感兴趣的:(算法,数据结构与算法)