Simple visual version of Bubble Sort, adapted from previous code
<----void draw() {
// If the mouse is pressed sort the array
if (mousePressed == true) {
bubbleSort(myArray);
for(int i=0;i
ellipse(50, +i*25, myArray[i]*2, myArray[i]*2);
print(" " + myArray[i]);
}
}
}
------>
No comments:
Post a Comment