Stacks and Queues


Vocabulary / Definition List

  • Stack - Linear data structure that stores items in a Last-In/First-Out (LIFO) or First-In/Last-Out (FILO) manner.

  • Queue - Linear data structure that stores items in First-In/First-Out (FIFO) manner.

  • Push - Nodes or items that are put into the stack.

  • Pop - Nodes or items that are removed from the stack.

  • Top - The top of the stack.

  • Peek - We use peek to view the value of the top Node in the stack, or the front Node in the queue.

  • IsEmpty - Returns true when the stack or queue are empty, otherwise returns false.

  • FILO - (First In Last Out) The first item added in the stack will be the last item popped out of the stack.

  • LIFO - (Last In First Out) The last item added to the stack will be the first item popped out of the stack.

  • FIFO - (First In First Out) The first item in the queue will be the first item out of the queue.

  • LILO - (Last In Last Out) The last item in the queue will be the last item out of the queue.

  • Enqueue - Nodes or items that are added to the queue.

  • Dequeue - Nodes or items that are removed from the queue.

  • Front - The front/first Node of the queue.

  • Rear - The rear/last Node of the queue.


  1. source
  2. stack
  3. queue

-back