rename modules after moving to appropriate folders
This commit is contained in:
parent
0b7be21d03
commit
a226f12645
16 changed files with 17 additions and 17 deletions
|
@ -1,41 +0,0 @@
|
|||
// common.js provides the advanced data structures.
|
||||
|
||||
export class Queue {
|
||||
#elements;
|
||||
|
||||
constructor() {
|
||||
this.#elements = [];
|
||||
}
|
||||
|
||||
enqueue(element) {
|
||||
this.#elements.push(element);
|
||||
}
|
||||
|
||||
dequeue() {
|
||||
return this.#elements.shift();
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return this.#elements.length <= 0;
|
||||
}
|
||||
}
|
||||
|
||||
export class Stack {
|
||||
#elements;
|
||||
|
||||
constructor() {
|
||||
this.#elements = [];
|
||||
}
|
||||
|
||||
push(element) {
|
||||
this.#elements.push(element);
|
||||
}
|
||||
|
||||
pop() {
|
||||
return this.#elements.pop();
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return this.#elements.length <= 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue