15 lines
267 B
Java
15 lines
267 B
Java
import java.util.List;
|
|
import java.util.Collection;
|
|
|
|
class Sorting{
|
|
void merge(a, b){
|
|
a.addAll(b);
|
|
return a;
|
|
}
|
|
|
|
sort(in){
|
|
var firstHalf = in;
|
|
var secondHalf = in;
|
|
return merge(sort(firstHalf), sort(secondHalf));
|
|
}
|
|
} |