Question: in Java Objective: you can only use java.util.linkedlist, java.util.queue,java.util.stack The goal of this assignment is to practice stacks and queues. Assignment: The first part of

in Java Objective: you can only use java.util.linkedlist, java.util.queue,java.util.stack

The goal of this assignment is to practice stacks and queues. Assignment: The first part of your assignment is to implement both a stack and a queue data structure. You may use either an array-based implementation or a reference-based list implementation (the one that is in the book). Your Stack class should implement the standard push(), pop(), and peek() methods, in addition to a constructor. Your Queue class should implement the standard enqueue(), dequeue(), and peek() methods, in addition to a constructor. Next, you will write two programs to test your Stack and Queue classes.

Queue Program: To-do List Write a program that uses a queue to implement a simple "todo" list. Each item in the list will have a name and an estimated time to complete. Your program will prompt the user for input. The user can either choose to complete the top task on the list, add a new task (with additional prompts for the name and estimated time to complete), or print the current list of tasks in an easy-to-read format. You may want to add a print method to your queue implementation to support this final task. Make sure to print an error message if the user tries to complete a non-existent task.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!