-Intro to Stack
-BIG O of Stacks
-Intro to Queues
Intro to Stacks
A stack is a last in first out data structure (LIFO) which means that the last element added to the stack will be the first element removed from the stack.
Stacks are used to manage function invocations.
As well as undo/redo actions.
BIG O of Stacks
Intro to Queues
A queue is a first in first out data structure (FIFO)
queues are used in background tasks, uploading resources, printing / task processing
class Queue {
constructor() {
this.first = null;
this.last = null;
this.size = 0;
}
}
class Node {
constructor(value) {
this.value = value;
this.next = null;
}
}
Top comments (1)
I don't really see how the #css and #html tags fit on this post