implement queue to keep track of splitting and merging

This commit is contained in:
Baipyrus 2024-05-23 21:29:34 +02:00
parent 6611378590
commit de1315fe08

View File

@ -33,6 +33,8 @@
// Start continuous animation
interv = setInterval(animate, 1000 / FPS);
queue.push(new ArrRef(0, AMOUNT));
});
class ArrRef {
@ -77,6 +79,8 @@
while (compr < b.length) (data[index + compr] = b.at(compr)), compr++;
}
/** @type {ArrRef[]} */
const queue = [];
/** Render a single frame of the sorting algorithm at a time on the canvas. */
function animate() {
// Clear canvas with black background