Question: Create an ExtLinkedList class by extending the LinkedList class to i nclude the following methods and estimate the run-time complexity of each method. Please Help!

Create an ExtLinkedList class by extending the LinkedList class to include the following methods and estimate the run-time complexity of each method.

Please Help!

  1. public ExtLinkedList evenList() // gets the elements E in locations 0,2,4,6,... of this list and puts them in a new ExtLinkedList in that order and returns it // make sure to handle errors

  2. public ExtLinkedList intsersect (ExtLinkedList eli) // picks out elements that are common to this ExtLinkedList and eli// and returns them in the form of a new ExtLinkedList // once again, you can use equals () method // the new list should not have duplicate elements // handle errors or exceptional situations appropriately. // example: this: {1,3,4,4}, parameter : {1,4,5,7} then return {1,4}

Template:

import java.util.*; public class ExtLinkedList extends LinkedList { public ExtLinkedList evenList() { // gets the elements E in locations 0,2,4,6, of this list and puts them in a new ExtLinkedList //in that order and returns it make sure to handle errors } public ExtLinkedList intsersect (ExtLinkedList eli) { } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!