Stacks and Queues - andrewkyllo-401-advanced-javascript/seattle-javascript-401d34 GitHub Wiki

Stack

  • A data structure that consists of Nodes where each Node references the next Node in the stack but not its previous.

FILO

  • First In Last Out means the first item added to the stack will be the last item to be popped out

LIFO

  • Last In First Out means the last item added is the first item to be popped out.

  • When popping a node off a stack remember to change the original tops .next to be null.

Queue

  • Similar to a stack however you can only remove nodes from the front and add to the back.

FIFO

  • The first item in the queue will be the first item out of the queue

LILO

  • The last item in the queue will be the last item out of the queue