generating new operations after job is done
This commit is contained in:
parent
eba7fac4db
commit
6dfb39ccbd
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user