Skip to content

Latest commit

 

History

History
21 lines (10 loc) · 481 Bytes

File metadata and controls

21 lines (10 loc) · 481 Bytes

Queue

It's an abstract data types
Works as FIFO First in, First Out

  • Push : adds an item as the top item on the stack
  • Pop: removes the top item on the stack
  • Peek: gets the top item on the stack without popping it.

Time Complexity

  • O(1) in push, pop, peek
  • O(n) in arrays because the array may have to be resized

Queue