CS 101 A+ Computer Science LINKED LIST IVARS Lab Goal : This lab was designed to teach you more about a linked list and using a linked list in a class as an...
A+ Computer Science LINKED LIST IVARS Lab Goal : This lab was designed to teach you more about a linked list and using a linked list in a class as an instance variable / data field. Lab Description : Use ListNode to write some basic LinkedList methods. PART 1 - Open the ListFunHouseTwo . java file and complete the methods in this class. PART 2 - Use the ListFunHouseTwoRunner to test your ListFunHouseTwo class. ListNode - stores a value and a reference to the next node public class ListNode implements Linkable private Comparable listNodeValue; EXTENSION : Modify ListNode by adding in private ListNode nextListNode; a ListNode prevList Node instance variable / data field. Rewrite the program as public ListNode () { listNodeValue = null; a double/circular linked list. nextListNode = null; public ListNode (Comparable value, ListNode next) { listNodeValue=value; nextListNode=next; Files Needed :: public Comparable getValue () { return listNodeValue; ListNode . java Linkable . java public ListNode getNext () { ListFunHouseTwo . java return nextList Node; ListFunHouseTwoRunner . java public void setValue (Comparable value) ( listNodeValue = value; public void setNext (Linkable next) { nextListNode = (ListNode) next; Sample Data : See the main of lab15c. Sample Output : Original list values over up -a-2-1 2. 1 34 at on go num nodes = List values after calling nodeCount over up -a-2-1 2.1 34 at on go List values after calling doubleLast over up -a-2-1 2.1 34 at on go go List values after calling doubleFirst over over up -a-2-1 2.1 34 at on go go List values after calling removeXthNode (2) over up 2.1 at go A+ Computer Science - Linked Lists - List values after calling setxthNode (2, one) over one 2.1 one go
Written for
- Institution
- Cornell University College Of Veterinary Medicine
- Course
- CS 101
Document information
- Uploaded on
- October 28, 2022
- Number of pages
- 13
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs 101 a computer science linked list ivars lab goal this lab was designed to teach you more about a linked list and using a linked list in a class as an