CSD 235/335 assignment 3 solved

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (8 votes)

Introduction
For this assignment you will be building upon an implementation a singly linked list. A skeletal
implementation of a singly linked list is provided as a starting point for the assignment. It was derived
from code taken from the text, “Starting out with Java: from control structures through data structures”,
3rd edition, Tony Gaddis and Godfrey Muganda.
The Modications
Add the following methods to LinkedList:
// return true if the String ‘e’is in the list
public boolean contains( String e );
// sort the list using a recursive merge sort
public void mergeSort();
// Remove the duplicates from a sorted list
public void removeDuplicates();
// compute the intersection and return its reference, of the linked list
// specified by the incoming parameter and the list referenced by ‘this’
public LinkedList intersect( LinkedList list );
// compute the union and return its reference, of the linked list
// specified by the incoming parameter and the list referenced by ‘this’
public LinkedList union( LinkedList list );
Do NOT put a “public static void main()” in LinkedList.java. Include an additional file in your project that
contains method main. Include enough tests in method main() to demonstrate that all the requirements
of the assignment have been met.
Hint
The intersect and union methods are set operations. Recall that a set does not have duplicates. The lists
that result from the computations should contain no duplicates.
Extra Credit
5/6/2020 Programming Assignment 3 – Linked Lists
https://lwtech.instructure.com/courses/1940982/assignments/18856026?module_item_id=43654334 2/2
Extra credit will be given to solutions that are the most efficient with respect to execution time and
memory usage. However, in order for a submission to be considered for extra credit, all of the
requirements of the assignment must be met.
What to Upload to Canvas
When you are finished with the assignment, upload the source files only to Canvas. There should be two
files to your submission; the modified LinkedList.java, and an additional file with a method main that
uses the class LinkedList.