Question

Generic Linked Lists ( Program should be written in Java language). Modify the linked list class...

Generic Linked Lists ( Program should be written in Java language).

Modify the linked list class presented in this chapter so it works with generic types. Add the following methods drawn from the java.util.List interface:

-void clear(): remove all elements from the list.

-E get(int index): return the element at position index in the list.

-E set(int index, E element): replace the element at the specified position with the specified element and return the previous element.

Test your generic linked list class with GenericLinkedListDemo.java.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Generic Linked Lists ( Program should be written in Java language). Modify the linked list class...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • JAVA - Circular Doubly Linked List Does anybody could help me with this method below(previous)? public...

    JAVA - Circular Doubly Linked List Does anybody could help me with this method below(previous)? public E previous() { // Returns the previous Element return null; } Explanation: We have this class with these two implemented inferfaces: The interfaces are: package edu.ics211.h04; /** * Interface for a List211. * * @author Cam Moore * @param the generic type of the Lists. */ public interface IList211 { /** * Gets the item at the given index. * @param index the index....

  • Write a generic array list class. Task Description Your goal for this lab is to write...

    Write a generic array list class. Task Description Your goal for this lab is to write a generic ArrayList class similar to the one in the given lecture notes on array lists. The ArrayList Class The public constructors and methods required for the ArrayList class are listed here. The type E is the generic type of an element of the list. ArrayList() Construct an empty ArrayList object. int size() Return the size (number of items) in this ArrayList. boolean isEmpty()...

  • C# is the language Create a generic class called “LinkedList” and implement the singly linked list....

    C# is the language Create a generic class called “LinkedList” and implement the singly linked list. Implement the following functions: - In C# Function Name Function Parameters Description Empty - Return true if empty else return false. Size - Return the current size of the list. Insert Value Insert the Value at the end of the list. Insert Index, Value Insert the Value at the specified Index. If the Index is out of range then insert the Value at the...

  • Given a singly-linked list interface and linked list node class, implement the singly-linked list which has...

    Given a singly-linked list interface and linked list node class, implement the singly-linked list which has the following methods in Java: 1. Implement 3 add() methods. One will add to the front (must be O(1)), one will add to the back (must be O(1)), and one will add anywhere in the list according to given index (must be O(1) for index 0 and O(n) for all other indices). They are: void addAtIndex(int index, T data), void addToFront(T data), void addToBack(T...

  • Q) Modify the class Linked List below to make it a Doubly Linked List. Name your...

    Q) Modify the class Linked List below to make it a Doubly Linked List. Name your class DoublyLinkedList. Add a method addEnd to add an integer at the end of the list and a method displayInReverse to print the list backwards. void addEnd(int x): create this method to add x to the end of the list. void displayInReverse(): create this method to display the list elements from the last item to the first one. Create a main() function to test...

  • Part I: Create a doubly linked circular list class named LinkedItemList that implements the following interface:...

    Part I: Create a doubly linked circular list class named LinkedItemList that implements the following interface: /** * An ordered list of items. */ public interface ItemList<E> {      /**       * Append an item to the end of the list       *       * @param item – item to be appended       */ public void append(E item);      /**       * Insert an item at a specified index position       *       * @param item – item to be...

  • CSBP 319 Data structures - Linked Lists - USE JAVA (NetBeans) A company would like to...

    CSBP 319 Data structures - Linked Lists - USE JAVA (NetBeans) A company would like to implement its inventory of computing machines as a linked list, called ComputerList. Write a Computer node class, called ComputerNode, to hold the following information about a Computer: • code (as a String) • brand (as a String) • model (as a String) • price (as double) • quantity (as int) ComputerNode should have constructors and methods (getters, setters, and toString()) to manage the above...

  • Please write in Java Recall that the ADT list class methods are;  void List() ...

    Please write in Java Recall that the ADT list class methods are;  void List()  bool isEmpty()  int size()  void add(int item, int pos)//inserts item at specified position (first postion is 1)  void remove(int index)//removes item from specified position  void removeAll()  int indexOf(int item)//returns the index of item  int itemAt(int index)//returns the item in position specified by index Implementation of LIST ADT operations and details are hidden. Only the methods listed above are...

  • Please help with this Java Program. Thank you! we will be implementing an Ordered List ADT....

    Please help with this Java Program. Thank you! we will be implementing an Ordered List ADT. Our goal is to implement the interface that is provided for this ADT. Notice that there are two interfaces: OrderedListADT builds on ListADT. In this homework, you'll only be responsible for the OrderedListADT. Figure 1: UML Overview 1 Requirements Create a doubly linked implementation of the OrderedListADT interface. Note that the book includes most of the source code for a singly linked implementation of...

  • Implement the Unsorted, sorted and indexed lists using Linked List base structure. (LLNode class under support...

    Implement the Unsorted, sorted and indexed lists using Linked List base structure. (LLNode class under support package) Files required: 1. ListInterface.java (given) 2. LLUnsortedList.java (implements ListInterface.java) 3. LLSortedList.java (extends LLUnsortedList.java, implements ListInterface.java) 4. LLIndexedList.java (implements LLIndexedListInterface.java, extends LLUnsortedList.java) 5. Driver ** Maybe create LLIndexedListInterface.java file too even though it is not required file! I need the bolded Java Files (5) to be written separate  classes please! The interfaces can be implemented from below! Thank you zip all your files and submit....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT