Solved–Lab 5 –Solution

$30.00 $19.00

A reference-based singly linked list is a basic data structure in computer science. Proficiency with linked lists is part of all CS tracks and represents a substantial portion of the Advancement Programming Exam. Create a Linked List class with a Dummy Head Node and the following: Embedded Node class with the following data members Comparable…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

5/5 – (2 votes)

A reference-based singly linked list is a basic data structure in computer science. Proficiency with linked lists is part of all CS tracks and represents a substantial portion of the Advancement Programming Exam.

  1. Create a Linked List class with a Dummy Head Node and the following:

    1. Embedded Node class with the following data members

      • Comparable data

      • Node next

    1. Embedded Node class with the following methods

      • Node(Comparable d)

      • Node(Comparable d, Node n)

    1. Private data members:

      • Node head

      • int size

    1. The following methods:

      • See CSCD211Lab5 The main method has 11 methods taken directly from the Java API. The only difference is E is Comparable and the parameter Object o in the API is also Comparable

  1. BoxCar is the data structure being placed into the LinkedList. A BoxCar only contains a String for its contents.

SOME SPECIFICATIONS

  • You must check ranges for the menu method

  • See my docs for the methods in BoxCar – Didn’t change from Lab4

  • You must ensure all appropriate preconditions – see the API for exceptions

  • It is expected that you will examine the similar methods in the API for LinkedList. Based on that examination you will throw the appropriate exceptions. You are not at this time required to deal with the exceptions just propagate them

For example anything with an index will throw

IndexOutOfBoundsException – if the index is out of range (index < 0 || index >= size())

TO TURN IN

A zip file containing:

  • All java files necessary to compile and run your program

  • Include an output file named cscd211Lab5out.txt.

.

Name your zip file your last name first letter of your first name lab5.zip (Example: steinerslab5.zip)