Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ListInterface.java:- package listInterface; public interface ListInterface { int size(); // return the number of elements on this list boolean isEmpty(); void add(E element); boolean remove

image text in transcribed

ListInterface.java:-

package listInterface;

public interface ListInterface {

int size(); // return the number of elements on this list

boolean isEmpty();

void add(E element);

boolean remove (E element);

// remove an element e from this list such that

e.equals(element) and return true;

// if no such element exists, return false

boolean contains (E element);

// return true if this list contains an element e such that

e.equals(element);

// otherwise, return false

E get(E element);

// return an element e from this list such that

e.equals(element);

// if no such element exists, return null

String toString();

// returns an appropriately formatted string that represents

this list.

void resetIterator();

// set the current position for the getNext() iterator to

the first element on the list

E getNextItem();

// Preconditions: The list is not empty

// The resetIterator() method has been

invoked

// The list has not been modified since the

most recent resetIterator() call

//

// return the element at the current position on this list;

// update the current pointer to point to the next element

on the list

// note: if the element returned is the last item on the

list,

// set the value of the current position to the first

element on the list

}

LLNode.java:-

package nodes;

public class LLNode {

private E info;

private LLNode next;

public LLNode(E info) {

this.info = info;

next = null;

}

public E getInfo() {

return info;

}

public void setInfo(E info) {

this.info = info;

}

public LLNode getNext() {

return next;

}

public void setNext(LLNode next) {

this.next = next;

}

}

Each student will be assigned one of the two List ADTs described further below. The List ADTs are to implement the attached Listinterface java, and include a toString0 method. The underlying data structure for each implementation shall be a singly linked list that uses the attached LLNode.java node class. A test program must also be developed. This program must verify each of the ADT operations and be consistent with the test plan Required elements all of your source code in a single Eclipse project partial test plan o identify what the goals of your testing are, and describe what your approach to testing will be in order to meet these goals exhaustive set of remove operation test cases nota bene: this a test plan, not a report of the testing you actually did o List ADT with a circular linked list as the underlying data structure List elements are to be maintained in the underlying linked list in insertion order, and the next instance variable for the most recently inserted node must point to the first, or "oldest", node on the list In addition to the operations included in Listlnterface.java, and the toString0 method, this list ADT must have a gnirtSot) method that returns a string that represents all of the list items presented in the reverse of their insertion order: toString) is to show the list items in insertion order, and gnirtSot0 is to show them in the opposite order The name of your list ADT class must be CircularList. The class header will look like this: public class CircularList implements ListInterface

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago

Question

Discuss about training and development in India?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago