Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 extends ArrayList implements Stack {

@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 extends LinkedList implements Queue{

@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

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions