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....
Wednesday, April 25
Subscribe to:
Post Comments (Atom)
1 comment:
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
}
Post a Comment