Question
Implement MyArrayStack class by extending ArrayList. Please create some variable to test whether whether each fuctions work or not. import java.util.ArrayList; import net.datastructures.*; public class
Implement MyArrayStack class by extending ArrayList. Please create some variable to test whether whether each fuctions work or not.
import java.util.ArrayList; import net.datastructures.*;
public class MyArrayStack
@Override public void push(E e) { // TODO Auto-generated method stub }
@Override public E top() { // TODO Auto-generated method stub return null; }
@Override public E pop() { // TODO Auto-generated method stub return null; }
@Override public int size() { // TODO Auto-generated method stub return super.size(); } @Override public boolean isEmpty() { // TODO Auto-generated method stub return super.isEmpty(); } }
Implement MyLinkedListQueue by extending LinkedList. Please create some variable to test whether whether each fuctions work or not.
import java.util.LinkedList; import net.datastructures.*;
public class MyLinkedListQueue
@Override public void enqueue(E e) { // TODO Auto-generated method stub }
@Override public E first() { // TODO Auto-generated method stub return null; }
@Override public E dequeue() { // TODO Auto-generated method stub return null; } @Override public int size() { // TODO Auto-generated method stub return super.size(); } @Override public boolean isEmpty() { // TODO Auto-generated method stub return super.isEmpty(); }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started