generating new operations after job is done

This commit is contained in:
Baipyrus 2024-05-21 20:03:33 +02:00
parent eba7fac4db
commit 6dfb39ccbd

View File

@ -54,6 +54,20 @@
this.start = start;
this.end = end;
}
/**
* Generates follow up jobs from response.
* @param {number[]} array
* @returns {Job[]}
*/
generate(array) {
if (this.done) return [];
return [
new Job(array, this.start ?? 0, this.index ?? 0),
new Job(array, this.index ?? 0 + 1, this.end ?? 0)
];
}
}
/** Represent a call to the quicksort algorithm. */