Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this Java Data Structures Assignment. RunTime Class - You will be expanding the functionality of the RunTime class to implement the

I need help with this Java Data Structures Assignment.

RunTime Class - You will be expanding the functionality of the RunTime class to implement the expanded RunTime Interface.

Array Based Queue Class - You will write the ArrayBasedQueue.java class which will implement the Queue Interface. Please note that Queue Interface extends the Iterable Interface

Linked Queue Class - You will write the LinkedQueue.java class which will implement the Queue Interface. Please note that Queue Interface extends the Iterable Interface. Also note that the Linked Queue Class should be a Doubly Linked Queue.

Iterable Interface - The Iterable Interface requires you to implement one method Iterator iterator(). So, all your Queue classes must implement this interface.

Element Iterator Class - You will write the ElementIterator.java class which will implement the Iterator Interface. Please note, you only need to implement two methods from the Iterator interface: boolean hasNext() and E next()

Node Class - You will write the Node.java. Please note that the Node Class is a node for a Doubly Linked Queue.

Driver Class - You will write the Driver.java class which will implement the Driver Interface. Please note that you do not inherit from the RunTime class. However, you do have to use the RunTime class to measure run times and memory usages.

image text in transcribed

image text in transcribed

Please note that the run times and the average are in Micro Seconds and the memory usage is in Kilo Bytes.

Runtime Interface Methods

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

public interface RunTimeInterface { public static enum TimeUnits {Seconds, MilliSeconds, MicroSeconds, NanoSeconds}; public static enum MemoryUnits {Bytes, KiloBytes, MegaBytes}; public TimeUnits getTimeUnits(); public void setTimeUnits(TimeUnits timeUnits); public MemoryUnits getMemoryUnits(); public void setMemoryUnits(MemoryUnits memoryUnits); public double getLastRunTime(); public double getLastMemoryUsage(); public double[] getRunTimes(); public double[] getMemoryUsages(); public void resetRunTimes(); public void addRuntime(long runTime); public double getAverageRunTime(); public double getAverageMemoryUsage(); }

Queue Interface Methods

image text in transcribedimage text in transcribed

Iterable Interface Methods

image text in transcribedimage text in transcribed

Iterator Interface Methods

image text in transcribedimage text in transcribed

Node Class

image text in transcribed

image text in transcribedimage text in transcribed

Driver Interface Methods

image text in transcribedimage text in transcribedimage text in transcribed

Queue Test cases All the elements being enqueued and dequeued from your queues must be instances of the java. land. String class. 1. Create an instance of your queue that accepts java.lang.String objects. Starting with an empty queue. use the enqueue e) method to add 10.000 java lang String objects (E representing the strings ("String 1 s String 10000") to the Queue. 2. Starting with an instance of your queue that accepts java.lang. Stringobjects that is fully populated with 10,000 java lang. String objects representing the strings ("String 1" K s String 10000 in the Queue. Use the dequeue method to remove all the objects from the queue, one at a time. 0 3. Starting with an instance of your queue that accepts java. lang. String objects that is fully populated with 10,000 java lang. String objects representing the strings ("String 1." s String 10000 in the Queue. Use the Iterator method to obtain an ElementIterator object. Use the ElementIterator object to display the strings from the queue one string per line. Queue Test cases All the elements being enqueued and dequeued from your queues must be instances of the java. land. String class. 1. Create an instance of your queue that accepts java.lang.String objects. Starting with an empty queue. use the enqueue e) method to add 10.000 java lang String objects (E representing the strings ("String 1 s String 10000") to the Queue. 2. Starting with an instance of your queue that accepts java.lang. Stringobjects that is fully populated with 10,000 java lang. String objects representing the strings ("String 1" K s String 10000 in the Queue. Use the dequeue method to remove all the objects from the queue, one at a time. 0 3. Starting with an instance of your queue that accepts java. lang. String objects that is fully populated with 10,000 java lang. String objects representing the strings ("String 1." s String 10000 in the Queue. Use the Iterator method to obtain an ElementIterator object. Use the ElementIterator object to display the strings from the queue one string per line

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

IBM Db2 11 1 Certification Guide Explore Techniques To Master Database Programming And Administration Tasks In IBM Db2

Authors: Mohankumar Saraswatipura ,Robert Collins

1st Edition

1788626915, 978-1788626910

Students also viewed these Databases questions