5. List and explain the Big-Oh runtimes of enqueue, dequeue, andgetFront for 2 different implemenations of a queue. Bothimplementaions use a node-based implementation (single-link) thathas pointers to both the head and tail nodes:
Implementation 1: enqueues at the head anddequeues at the tail
Implementation 2: enqueues at the tail anddequeues at the head
A)
Implementation 1) Enqueue = O(1) as putting node in head takesconstant time.
Dequeue = O(n) as to delete a node from tail we have to scan thewhole list first.
getFront = O(1) as we are enqueuing at the head.
Implementation 2) Enqueue = O(n) as to insert a node from tailwe have to
PayPal Gateway not configured
PayPal Gateway not configured