implement queue to keep track of splitting and merging
This commit is contained in:
parent
6611378590
commit
de1315fe08
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user