2015-02-27

posted Feb 26, 2015, 9:52 PM by Samuel Konstantinovich   [ updated Feb 28, 2015, 11:35 AM ]
-Use your merge function to help you write a merge sort.
-All of your sorts will apply to int arrays.
-All of your sorts will be static methods. 

Merge sort should be completed by Tuesday.
Which means you should have:
01RECURSION
02KNIGHTS
03NQUEEN
04USACO
05MERGESORT


For the USACO problems:
  While the bronze problem has a thorough test case, the silver does not. Try the following as a test case and see if you all agree:
 
/////////////// Test case 1, result = 114384
5 5 14
....*
.....
..*..
.....
*....
1 1 5 5


///////////////Test case 2, result = 81891116
7 7 22
....*..
.*.....
..*...*
.......
*...*..
.*.....
....*..
1 1 7 7


For the MERGESORT:   
File:
   Sorts.java
Method:
   public static void mergesort(int[]);


Test cases should be int arrays that are:
 1. sorted
 2. reverse sorted, 
 3. randomized with:
   3a.  a tiny range of values (only 1,2, and 3's)
   3b. a wide range of values (-1,000,000 to +1,000,000)

Does any of this change the speed?
  

 

Comments