Custom Sort

Compare

Swap

Flip

Shuffle

Done

Your Own Custom Sort:

// Your code goes here // Follow the instructions below to implement your code within this sort visualizer // Here is an example of a bubble sort implementation async function sort() { for (let a = 0; a < array.length; a++) { for (let r = 0; r < array.length - a - 1; r++) { await compare(r, r + 1); if (array[r] > array[r + 1]) { swap(r, r + 1); await sleep(); if (firstRun) return } } } }

To utilize this page, follow the instructions below and write your sorting algorithm code. After that, click 'Run' to visualize it. The page auto-evaluates your code without a 'Save' or 'Reset' button. Here are the essential functions:

Other important aspects include:

For further guidance or custom sort creation, review the sort.js file in the console (accessible by pressing F12 or 'Inspect' button when right-clicking).

IMPORTANT NOTE: Use the console for viewing, testing, and debugging your code. Open the console by pressing F12 or 'Inspect' button.

light dark