Question: MyStack.java Implement a stack using linked lists data structure. Implement your own linked list. You cannot use Java's java.util.LinkedList pop0: returns and removes the last

MyStack.java Implement a stack using linked lists data structure. Implement your own linked list. You cannot use Java's java.util.LinkedList pop0: returns and removes the last value on the stack push(String item): Push a given value onto the stack isEmpty0: returns true or false depending on if the stack is empty printStack): prints the items on the stack to console Handles errors for all possible edge cases (i.e. doesn't throw an unhandled exception to the user) MyStack Stringl] list): constructor which creates the stack with the items in list on the stack. So if list had [a, "b" "c") the stack would look like: "c" on top of eb" on top of a- MyQueue.java Implement a queue using the MyStack.java implementation as your data structure. In other words, your instance variable to hold the queue items will be a MyStack class. enqueue(String item: inserts item into the queue dequeue: returns and deletes the first element in the queue isEmpty:returns true or false depending on if the queue is empty printQueue): prints the items in the queue to console MyQueue(Stringl] list): constructor which creates the queue with the items in list in the queue: So if list had ['a", "b" "c") the queue would look like: "a" first, then "b", then "c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
