Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All submissions to be graded for this assignment must be made using the Submit Assignment button at this posting Do not post any files in

  • All submissions to be graded for this assignment must be made using the Submit Assignment button at this posting
  • Do not post any files in comments
  • Seven points will be deducted from your grade if you submit a source code file that does not compile; if you submit a source code file that does not compile a second time, an additional three points will be deducted
  • Students who do not make a meaningful initial submission by the Due date deadline will be assigned an alternative problem for this project

Develop and test two Java classes:

  1. An array-based queue ADT that implements the provided QueueInterface.java
    • The enqueue and dequeue must both be O(1)
    • This class must include two constructors:
      1. one with no parameters, that will instantiate an underlying array of size 4
      2. one with a single parameter that will allow logical level code to specify the size of the underlying array
  2. A linked list-based queue ADT that implements the provided QueueInterface.java

In addition to submitting the source code for the two ADT classes, you must also submit a test program. I will provide a set of cases that you will code up.Details to be provided.

Project absolutes - failure to meet any of the following requirements will disqualify your submission from being considered:

  • You may not make any changes to QueueInterface.java
  • The ADT classes must be generic
  • The attached generic singly linked list node class, LLNode.java, must be used for the linked list-based queue; you may not make any modifications to this class
  • The name of the array-based queue class must be ArrayQFirstnameLastname, where Firstname is your first name and Lastname is your last name
  • The name of the linked list-based queue class must be LLQFirstnameLastname, where Firstname is your first name and Lastname is your last name
  • Your implementations cannot throw any exceptions
  • Your implementations cannot include a main method
  • Your implementations cannot include input or output instructions
  • You must organize your source code files in the following package structure:
    • ADT classes must be in the adts package
    • The test program must be in the apps package
    • QueueInterface.java must be in the interfaces package
    • LLNode.java must be in the nodes package
  • Both queue classes must include a toString( ) method that returns a string representation of the queue in order from front to rear, without any newline or carriage return escape sequences.

You are encouraged to review the rubric below for details on how the project will be graded.

BE SURE TO ASK QUESTIONS IF YOU HAVE ANY DOUBTS ABOUT WHAT IS EXPECTED FOR THIS ASSIGNMENT!

package interfaces; public interface QueueInterface { void enqueue(E element); // add an element to the queue - always at the end of the queue E dequeue(); // remove and return the front of the queue boolean isEmpty(); boolean isFull(); }

------------------------------------ package nodes; public class LLNode { private E data; private LLNode next; public LLNode(E data) { this.data = data; next = null; } public E getData() { return data; } public void setData(E data) { this.data = data; } public LLNode getNext() { return next; } public void setNext(LLNode next) { this.next = next; } }

---------------------------------

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here are the implementations of the arraybased and linked listbased queue ADTs along with the test program ArrayQFirstNameLastNamejava package adts im... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What is an access control list?

Answered: 1 week ago

Question

20. What is a feature detectorpg105

Answered: 1 week ago