Overview

For this project you will implement a basic linked and a sorted linked list. Notice that no public tests are part of this project as all tests are either release or secret.

Objectives

This project will allow you practice linked lists and testing.

Grading

Clarifications

Any clarifications or corrections associated with this project will be available at Project Clarifications.

Code Distribution

The project's code distribution is available by checking out the project named LinkedListsProject. The code distribution provides you with the following:

Specifications

You are expected to implement two classes: BasicLinkedList and SortedLinkedList.The javadoc describing what you need to implement can be found at Project Javadoc.

Requirements

Additional Requirements for Students in CMSC 132H (Honors)

Sample Driver

The following driver and associated output provide an idea of the classes you need to implement.



import listClasses.BasicLinkedList;
import listClasses.SortedLinkedList;

public class SampleDriver {

	public static void main(String[] args) {
		BasicLinkedList<String> basicList = new BasicLinkedList<String>();

		basicList.addToEnd("Red").addToFront("Yellow").addToFront("Blue");
		System.out.println("First: " + basicList.getFirst());
		System.out.println("Last: " + basicList.getLast());
		System.out.println("Size: " + basicList.getSize());
		System.out.println("Retrieve First: " + basicList.retrieveFirstElement());
		System.out.println("Retrieve Last: " + basicList.retrieveLastElement());
		System.out.println("Removing Red");
		basicList.remove("Red", String.CASE_INSENSITIVE_ORDER);
		System.out.print("Iteration: ");
		for (String entry : basicList) {
			System.out.print(entry + " ");
		}
		
		SortedLinkedList<String> sortedList = new SortedLinkedList<String>(String.CASE_INSENSITIVE_ORDER);
		sortedList.add("Yellow").add("Red");
		System.out.print("\n\nIteration (for sorted list): ");
		for (String entry : sortedList) {
			System.out.print(entry + " ");
		}
		sortedList.remove("Red");
		System.out.print("\nAfter remove in sorted list first is: ");
		System.out.println(sortedList.getFirst());
	}
}

Output

First: Blue
Last: Red
Size: 3
Retrieve First: Blue
Retrieve Last: Red
Removing Red
Iteration: Yellow 

Iteration (for sorted list): Red Yellow 
After remove in sorted list first is: Yellow

Web Accessibility