All you need to focus on is writing two sorting algorithms. One in sorts/insertionSort.js
and the other in sorts/selectionSort.js
.
Open index.html
to see your sorting algorithm played back to you visually:
- A red flash indicates that an array element has been written
- A green flash indicates that an array element has been read
- Write insertion and selection sort
- Understanding that one visual action (either a read or write) is occurring for each array every frame, describe what this is an accurate (and inaccurate) time representation of
- Provide an explanation for the different speeds of the sorts
- Provide an explanation for how both changes in array sizes as well as changes in how scrambled the arrays are would affect performance for the sorting algorithms
- Feel free to alter the size of the arrays and duration of the steps in config.js