Question: 1. Construct a class Queue that implements a queue using a linked list with the following capabilities: a. enqueue-add an item to the end of
1. Construct a class Queue that implements a queue using a linked list with the following capabilities: a. enqueue-add an item to the end of the queue b. dequeue - remove an item from the front of the queue c. length - determine the length of the queue d. peek - print out the item at the front of the queue (but do not remove). e. printqueue - print out the whole queue. The item to be added to each node in the queue will be an object from a class named LLitem which contains three data attributes: attr 1 (type str), attr2 (type float), attr3 (type list). When an object from LLitem is instantiated, it's data attributes are to be initialized. You are to build the queue in the following order: 1. enqueue 2. enqueue 3. enqueue 4. peek 5. length 6. dequeue 7. length 8. printqueue You may choose the values contained in each item to be added to the queue You may decide how to format printed items from the queue nodes. Assignment guidelines You will upload a single .py file that contains your Python script solution using the link provided in the assignments tab. Your file must contain a comments section that contains a. Your name, course number and data b. Sample output from your program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
