Question: Your assignment is to program (in Java) the following: Create a Stack class that is a Generic (See Lecture on Stacks/Generics or search for how

Your assignment is to program (in Java) the following:

Create a Stack class that is a Generic (See Lecture on Stacks/Generics or search for how to program generics)

Use the same method names as in the video

Create a Queue class that is Generic

use the same method names as in the video

These should be implemented using linked structures, not arrays. The video shows a linked structure of an integer based stack and queue, but the video doesn't show the node class.

Look at the notes or search for how to create a linked node class - (Lecture #3, Slide 28 LinearNode class)

Create a custom exception class and throw an exception if removing or popping, peeking a null queue/stack.

See Lecture #2-slide 34 for exceptions.

Turn in your Java code and a test program that demonstrates the stacks and queues working. I do not want print outs of your code, I want files I can compile and run.

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!