function minimumTimen number relations number time number number let g = Arraynfillnullmap = ; let deg = Arraynfill0; for const x y of relations gx - 1pushy - 1; degy - 1++;
The error message states that "Queue is not a constructor". This means that the code is trying to create a new instance of a class called "Queue", but it is unable to find the constructor for that class.
To fix this error, you need to define a class called "Queue" and provide a constructor for it. Here's a possible implementation of the Queue class:
class Queue<T> {
private elements: T[];
constructor() {
this.elements = [];
}
enqueue(element: T): void {
this.elements.push(element);
}
dequeue(): T | undefined {
return this.elements.shift();
}
isEmpty(): boolean {
return this.elements.length === 0;
}
}
You can add this class definition before the minimumTime function and the error should be resolved
原文地址: http://www.cveoy.top/t/topic/il1O 著作权归作者所有。请勿转载和采集!