Question: Need Python Codes for the following functions: Use List to create a queue, where the front of the queue points to the first element and
Need Python Codes for the following functions:
Use List to create a queue, where the front of the queue points to the first element and the rear of the queue points to the last element of the List.
(a) def enQueue(lst, data): # Adds element x at the back of the queue (b) def deQueue(lst): # Removes and returns element at front of the queue (c) def front(lst): # Returns (but doesn't remove) element at front of queue (d) def is_empty(lst): # Returns True if the queue is empty else False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
