I need to complete and test class SortLinkedList below which is intended to perform a mergesort on a linked list of LinearNodes referencing Comparable objects, by providing code to:
Complete the method printList which outputs the list to the output file.
Complete the recursive method countList which counts the number of items on the list
Complete the code for method LinkedMergeSort as indicated
Here is my code:
Thanks for any help anyone can give me. Joe.
public static void printList(LinearNode L)
// how do i output the list to the file here??}
public static int countList(LinearNode L)
// how do i count the number of items on the list here
// using a recursive method??
The answer to this depends on what class LinearNode is and does, about which we know nothing. Have you checked its API to see if there may be helpful methods in it?