Overview

  • Last in first out (LIFO)
  • Basic operations: Enqueue, Dequeue, Peek
  • Can be implemented with a linked nodes,  array, or two stacks.

 

Queue

 

Advantages

  • Easily maps to many problems.
  • Quick inserts and deletes

Disadvantages

  • Not ideal for search operations.
  • Cannot easily add or remove elements in the middle.

Time Complexities

Leave a Reply

Your email address will not be published. Required fields are marked *