• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mergesort referencing Comparable objects  RSS feed

 
Joe Grimp
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok here is what i have to do -

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.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like an assignment that you should be doing, so any help provided here will be general in nature.

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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!