Question: IN PYTHON PLEASE Implement a queue using a linked list. Requirements: . Your code must be in a class named LinkedListQueue. You must implement these

IN PYTHON PLEASE
Implement a queue using a linked list. Requirements: . Your code must be in a class named LinkedListQueue. You must implement these three methods: enqueue, dequeue, and is_empty. Your queue must be implemented with a linked list made of Node objects. The Node class is provided in the starter code. enqueue will take a value as an argument, create a new Node object with that value, and add that node to the end of the queue. It should return nothing. dequeue will take no arguments, remove the Node object at the front of the queue, and return its value. If the queue is empty, it should do nothing except return None. is_empty will take no arguments and return True if the queue is empty and False otherwise. Your implementation may not use Python's built-in list or any other data structures in the Python standard library. You may not use any other linked list implementation besides the Node class. Here is an example of how your LinkedListQueue should work: q - LinkedListQueuel) # creates an empty queue q.enqueue(1) #adds 1 to end of queue print(q.is_empty()) # prints False 9.enqueue(2) # adds 2 to end of queue q.enqueue(3) # adds 3 to end of queue # queue now looks like: 1 - 2 -> 3 -> None printiq.dequeue()) #prints 1; queue now looks like 2 > 3 -> None print(q.dequeue()) #prints 2 printiq.dequeue()) #prints 3 printiq.is_empty()) #prints True print(q.dequeue()) # prints None, because queue is empty Totalnaintr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
