DSA 02 - morgan-401-advanced-javascript/seattle-javascript-401n14 GitHub Wiki

READING

Resources

Read: Stacks and Queues

Link

FILO

First In Last Out

This means that the first item added in the stack will be the last item popped out of the stack.

LIFO

Last In First Out

This means that the last item added to the stack will be the first item popped out of the stack.

FIFO

First In First Out

This means that the first item in the queue will be the first item out of the queue.

LILO

Last In Last Out

This means that the last item in the queue will be the last item out of the queue.

Common terminology for a queue is

  • Enqueue - Nodes or items that are added to the queue.
  • Dequeue - Nodes or items that are removed from the queue.
  • Front - This is the front/first Node of the queue.
  • Rear - This is the rear/last Node of the queue.
  • Peek - When you peek you will view the top Node in the queue. If the queue is empty, and you don’t peek, you will receive a NullReferenceException.