Question: Write a Java program of the implementation of a linked list. The program includes lList.java and lListTester.java. Note : in lListTester.java you have to use
Write a Java program of the implementation of a linked list. The program includes lList.java and lListTester.java. Note: in lListTester.java you have to use TDD (test-driven development) to develop the class.
Here is the specification for the lLink class:
| <> lList |
| +info : string +nextList : lList |
| +isEmpty() : bool +insert() +nextList() : lList +lSize() : int +deleteInfo() +traverse() : string |
The behaviors are as follows:
isEmpty() return true if lList is empty, i.e. info is null and nextList is null.
insert(inInfo) returns nothing. Place inInfo into lList as a new lList at the beginning of the current lList.
nextList() returns lList. If the current list is not empty, it returns a reference to the beginning of the remaining list. If the current list is empty it returns null. If the current list references G then this.nextList() would return a reference to F. If the current list is empty (/) then this.nextList() would return null.
lSize() returns an integer which counts the number of none-empty sublists in the current list + 1. If this references G then this.lSize() would return 3. If this references F then this.lSize() would return 2/ If this references / then this.lSize() would return 0.
deleteInfo(outInfo) returns a reference to the start of the list following the information removed if it exists.
traverse() returns a string which is the current natural order of the linked list as a comma separated set of strings.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
