An algorithm like Selection Sort can be easily understood by visualizing instead of long codes.
It is implemented using HTML, CSS & JavaScript.
Selection Sort. Basic HTML, CSS & JavaScript. JavaScript promises. JavaScript async/await function.
- Button Generate New Array generates an array of random values using the Math.random() function and a bar corresponding to that value in terms of height.
- Different colors are used to indicate which elements are unsorted(sky-blue), compared(darkblue & red) & sorted(lightgreen).
- Button Selection Sort the elements using the selection sort algorithm.
- Finally, elements are sorted.