Wednesday, April 25

Bubble Bubble....

Bubble...bubble....bubble?

bubble bubble bubble, bubble, bubble, bubble bubble bubble.....

bubble bubble sort? bubble sort sort bubble sort bubble bubble bubble.....

bubble bubble bubble bubble....

sort SORT....bubble bubble...bubble bubble...bubble...bubble...bubble

bulbe...bulba....bulbasaur....

bulba bulbsaur....

bubble
bubble....

1 comment:

Jason moofang said...

Bubblesort is my fave!

void swap(T a, T b) {
T temp = a;
a = b;
b = temp;
}

T[] bubbleSort(T[] a) {
int unsorted = a.length;
for (;unsorted != 0; unsorted--) {
for(int i=1;
i!=unsorted;
i++) {
if(a[i-1] > a[i])
swap(a[i-1], a[i]);
}
}
return a
}