Due: Friday 1/03 10:00am
Submission name: work34_sort
Update For Friday 12/20
Code on the thesource
has been updated as follows:
- Fields had been added for selection and insertion sort variables.
- Color highlights have been added for the selection and insertion sorts.
- A working
bubbleSortOnce()
method has been added.
MOAR Sort!
Eventually, the sort program you started yesterday will contain code for the following algorithms:
- Bubble sort (presented in class 12/18)
- Selection sort (12/19)
- Insertion Sort (12/20) You can see a working demo of each sort here: http://homer.stuy.edu/~dw/p5js/sort/
- Grab the
Sort
code fromthesource
. - There is a class called
SoryArray
which we will be using to write cdoe for various sorting algorithms. - Find the
bubbleSortOnce()
method, which already contains comments meant to guide you through the bubble sort algorithm we discussed in class. It is only designed to do a single step of the bubble sort, which will then allow us to watch the algorithm in processing. - Use the instance variables provided in the
SortArray
class, as well as the providedswap()
method. - Do the same for
SelectionSortOnce()
andinsertionSortOnce
, as we discuss them in class.