Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ebdav/pid-17101905-dt-content-rid-114820150 1/courses/2017Fall-T-CSE205-70738/Homework In the Assignment, you are given three files Assignment 10 java, LinkedList.java, Listlterator.java. You will need to add additional methods in the LinkedList

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
ebdav/pid-17101905-dt-content-rid-114820150 1/courses/2017Fall-T-CSE205-70738/Homework In the Assignment, you are given three files Assignment 10 java, LinkedList.java, Listlterator.java. You will need to add additional methods in the LinkedList class in the LinkedList.java file. The LinkedList will be tested using strings only. Specifically, the following methods must be implemented in the LinkedList class: (You should utilize listlterator method already defined in the LinkedList class to obtain its LinkedListlterator object, and use the methods in the LinkedListlterator class to traverse from the first element to the last element of the linked list to define the following methods.) public int size) The size method returns the number of strings that the linked list contains at the time when this method is called. public int searchElenent(Object element) The searchElement method checks at which index the parameter element (string) is located, and returns its index. If the linked list does not contain the parameter element, then it retums -1. public Object getElement(int index) The getElement method returns an element at the given index passed as its parameter If the parameter index is larger or smaller than the existing indices, it should throw an IndexOutOfBoundsException. public void setElement (int index, Object element) The setElement method set/replace the original element at parameter index with the parameter element, all other elements remain unchanged. If the parameter index is larger or smaller than the existing indices, it should throw an object of the IndexOutOfBounds Exception class

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

=+Describe an important trade-off you recently faced

Answered: 1 week ago