Link to home
Start Free TrialLog in
Avatar of Rowley4
Rowley4

asked on

Generic version of merge sort algorithm

I need to implement a generic version of the merge sort algorithm

import java.util.Arrays;

public class MergeSortTester
{
   public static void main(String[] args)
   {
      String[] words = 
      {
         "Mary", "had", "a", "little", "lamb"
      };

      MergeSorter<String> sorter = new MergeSorter<String>(words);
      sorter.sort();
      System.out.println(Arrays.toString(words));      
      System.out.println("Expected: [Mary, a, had, lamb, little]");
   }
}

Open in new window

Avatar of robthewolf
robthewolf
Flag of Israel image

what is the question
Avatar of Rowley4
Rowley4

ASKER

I am not sure how to implement a generic version of the merge sort algorithm into this code.
ASKER CERTIFIED SOLUTION
Avatar of robthewolf
robthewolf
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial