Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

12:53 PM @ 66% Lab 4 Lab4.docx Introduction to the Linked List Goal: In this lab, you will gain experience working with the linked list

image text in transcribed
12:53 PM @ 66% Lab 4 Lab4.docx Introduction to the Linked List Goal: In this lab, you will gain experience working with the linked list data structure by adding methods to the LinkedQueue class. Task 1: Verify that the LinkedQucue class does, in fact, implement the queue data structure. Do this by asking the user to enter five names. Add each name to the queue. Once all names are added, write a loop to remove the names and print them. If the names are all printed in the same order in which they were entered, the queue works! Task 2: Add the following method to the LinkedQueue class that returns true if the given element is in the queue and false otherwise public boolean contains (Object o) Task 3: Add the following method to the LinkedQueue class that counts the number of times the given element appears in the queuc public int countoccurrences (Object o) Task 4: Add the following method to the LinkedQueue class that returns the queue formatted as a string. The string must have the format a, b, c, d]" where a, b, c and d are the elements in the queue. public String toString ) Task 5: Add the following copy constructor to the LinkedQueue class. This constructor creates a new queue that is a copy of the given queue. Be careful not to destroy the given queue public LinkedQueue (LinkedQueue extends E Dashboard Calendar To Do Notifications Inbox

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions