FileDocCategorySizeDatePackage
BubbleSortAlgorithm.javaAPI DocExample1334Tue Dec 12 18:57:48 GMT 2000None

BubbleSortAlgorithm

public class BubbleSortAlgorithm extends SortAlgorithm
A bubble sort demonstration algorithm SortAlgorithm.java, Thu Oct 27 10:32:35 1994
author
James Gosling
version
1.6f, 31 Jan 1995

Fields Summary
Constructors Summary
Methods Summary
voidsort(int[] a)

	for (int i = a.length; --i>=0; )
	    for (int j = 0; j<i; j++) {
		if (stopRequested) {
		    return;
		}
		if (a[j] > a[j+1]) {
		    int T = a[j];
		    a[j] = a[j+1];
		    a[j+1] = T;
		}
		pause(i,j);
	    }