---
title: "冒泡排序"
author: "sunwch"
date: "2010-05-18T13:21:31Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-05-18T14:54:50Z"
id: 668892
url: "https://sunwch.iteye.com/blog/668892"
---

private static int bubbleSort(int a){
		for(int k=0;k<a.length;k++){
			for(int i=0;i<a.length;i++){
				if(a < a*){
					int temp = 0;
					temp = a*;
					a* = a;
					a = temp;
				}
			}
		}
		return a;
	}
其数据项移动次数为（n*(n-1)/2）