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 (var i = 0; i < array.length; i++) { for (var j = 0; j < array.length - i - 1; j++) { if (await compare(j, j + 1)) { swap(j, j + 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