Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA LinkedListBox Specifically, implement your generic classes as: public class LinkedListNode { public E element; public LinkedListNode next; } public class LinkedListBox { public LinkedListNode

JAVA

LinkedListBox

Specifically, implement your generic classes as:

public class LinkedListNode { public E element; public LinkedListNode next; } public class LinkedListBox { public LinkedListNode head; public LinkedListNode tail; public int count = 0; }

Within the LinkedListBox class, implement the following methods:

public boolean add(E e). Returns true after adding an element to the end of the list.

public E get(int idx). Returns element at index position idx.

public E set(int idx, E e). Changes the element at position idx to e. Returns old element.

public E remove(int idx). Removes element at position idx from the list and returns it.

public int size(). Self-explanatory

public boolean isEmpty(). Self-explanatory

public Integer find(E e). Search for element e in the linked list and return its index position or return null if not found.

public E removeFirst(). Remove and return the element at the head of the list.

public E removeLast(). Remove and return the element at the tail of the list.

public void addFirst(E e). Add an element to the front of the list.

public void insert(int idx, E e). Insert an element right after the index idx position.

Create a driver class called LinkedListBoxDriver. Provide the user a menu: 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. Insert an element(String) after index. 5. List the contents of the box. 6. Exit program

java program

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

=+(2,7", P+ ) is the completion of (, , P).

Answered: 1 week ago

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago