Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bookmark I need help for part 2 if you do part 1 that's fine but I really need help on part 2 please Make sure

Bookmark

I need help for part 2 if you do part 1 that's fine but I really need help on part 2 please

Make sure that your code contains comments explaining your code.

Use Chapter 14 as a guide to complete the following part 1 and 2 below. You can delete references to the jsjf exceptions (you may also need to modify the code as well in parts that reference it).

Part 1. Complete the implementation of the LinkedQueue class presented in this chapter. Specifically, complete the implementation of the first, isEmpty, size and toString Methods. Also create a driver class (main) to test the functionality of the methods of your program. ToString should print all the elements in the Queue.

Part 2. Complete the implementation do the CircularArrayQueue class described in chapter 14, including all methods. Also create a driver class (main) to test the functionality of the methods of your program.

 
package jsjf.exceptions; /** * Represents the situation in which a collection is empty. * * @author Java Foundations * @version 4.0 */ public class EmptyCollectionException extends RuntimeException { /** * Sets up this exception with an appropriate message. * @param collection the name of the collection */ public EmptyCollectionException(String collection) { super("The " + collection + " is empty."); } } 
package jsjf; /** * Represents a node in a linked list. * * @author Java Foundations * @version 4.0 */ public class LinearNode { private LinearNode next; private T element; /** * Creates an empty node. */ public LinearNode() { next = null; element = null; } /** * Creates a node storing the specified element. * @param elem element to be stored */ public LinearNode(T elem) { next = null; element = elem; } /** * Returns the node that follows this one. * @return reference to next node */ public LinearNode getNext() { return next; } /** * Sets the node that follows this one. * @param node node to follow this one */ public void setNext(LinearNode node) { next = node; } /** * Returns the element stored in this node. * @return element stored at the node */ public T getElement() { return element; } /** * Sets the element stored in this node. * @param elem element to be stored at this node */ public void setElement(T elem) { element = elem; } } 

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

=+40-2 Discuss how social networking influences us.

Answered: 1 week ago