Question: Hi, this is for programming 2 with the java language. I missed lab class so I am a good bit lost. I could really use
CSC 205 Lab 10 : Linked Lists Goals After completing this lab, you should be able to: Understand object references and the advantages of a dynamic linked list over an array. Be able to display and count the contents of a linked list Insert a node into a specified position of a linked list. Lab Startup Change into your Labs directory, and let's create and change into a Lab10 directory. Now, let's copy over some files by typing: cp /pub/digh/CSC205/Lab10/ Building and Tracing a Simple Linked List Take a look at the Links.java program in your attached handout. Draw the linked list that would be created by the ma in method. Now, compile and run the Links program and check to see if your list prints out in the manner that you would expect given a head pointer to the front of your list. Writing Simple Methods for Processing Linked Lists Add a recursive method named count to your Links program that can be used to count and return the number of nodes pointed to by a head pointer. Your method will have one parameter, the pointer head. Add an iterative method named findMax to your Links program that returns the largest value in a linked list pointed to by a head pointer. Your method will have one parameter, the pointer head. You should not be concerned about the data type of the elements stored in your nodes. Use the Comparable interface appropriately in your method Include method calls in ma in to test both of your new methods. CSC 205 Lab 10 : Linked Lists Goals After completing this lab, you should be able to: Understand object references and the advantages of a dynamic linked list over an array. Be able to display and count the contents of a linked list Insert a node into a specified position of a linked list. Lab Startup Change into your Labs directory, and let's create and change into a Lab10 directory. Now, let's copy over some files by typing: cp /pub/digh/CSC205/Lab10/ Building and Tracing a Simple Linked List Take a look at the Links.java program in your attached handout. Draw the linked list that would be created by the ma in method. Now, compile and run the Links program and check to see if your list prints out in the manner that you would expect given a head pointer to the front of your list. Writing Simple Methods for Processing Linked Lists Add a recursive method named count to your Links program that can be used to count and return the number of nodes pointed to by a head pointer. Your method will have one parameter, the pointer head. Add an iterative method named findMax to your Links program that returns the largest value in a linked list pointed to by a head pointer. Your method will have one parameter, the pointer head. You should not be concerned about the data type of the elements stored in your nodes. Use the Comparable interface appropriately in your method Include method calls in ma in to test both of your new methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
