Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.54 KB

Queue.md

File metadata and controls

47 lines (34 loc) · 1.54 KB

slides available here

#QUEUE by Jose Torres @CoderPug

##Concepts

  • ADT Abstract Data Type
  • Flexible size ( don't have to pre allocate memory, just add as you go ) ( When implemented with linked lists )
  • FIFO scheme ( First In First Out )

image

##Operations

  • Enqueue(:object) - inserts element at the tail (end)
  • Dequeue() - remove and returns element at the head (front)
  • Auxiliary
    • front() - returns element in head without removing it
    • size() - returns number of elements stored
    • isEmpty() - returns boolean

##Representation

  • When using Linked List is composed as :
    • Node: { data, next< Node > }
    • Queue: { pointerHead< Node >, pointerTail< Node > , funcs... }

##Complexity

  • Insert : O(1)
  • Remove : O(1)
  • Front: O(1)
  • Size : O(1)

##Direct Applications

##Problems

##Bibliography

I totally stole the images from HackerRank - https://www.hackerrank.com/topics/queues