Avila University Python Programming Project

User Generated

xnvgu

Programming

Description

Unformatted Attachment Preview

P ROBLEM Using the given generic interface LinkedList.java and the generic class Node.java, create a class MyLinkedList.java which is a generic class which implements LinkedList.java. It should contain the following attributes: • Node head – the first value of the linked list As well as the following constructors/methods: • • add(E item): void – Adds a new Node containing the item E to the end of the linked list. add(E item, int loc): void – Adds a new Node containing the item E at the location loc, shifting the item already there forward if necessary. • remove(E item): void – removes the first node containing a value equal to item, adjusting the order the linked list traverses if necessary. • • • • clear(): void – Empties the linked list entirely. getSize(): int – returns the size of the list by traversing through the linked list. getValue(int loc): E – returns the value of the node located at index loc. indexOf(E item): int – returns the index of the first node that contains the value item. rev. February 16 – 1 / 1
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
Excellent resource! Really helped me get the gist of things.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
Similar Content
Related Tags