Check out a live demo here!
We use generator functions to update the DOM while sorting.
We [mostly] follow this color convention:
- Default colored
black
. - Comparing colored
yellow
. - Correct position colored
green
. - Incorrect position colored
red
. - Completed colored
blue
. - Algorithm specific items (for example, the pivot in quick sort) are colored
cyan
.