2018-09-10 02:36:53 +02:00
|
|
|
import java.util.List;
|
2018-09-11 21:59:20 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.lang.String;
|
2018-09-10 02:36:53 +02:00
|
|
|
|
|
|
|
class Sorting{
|
|
|
|
merge(a, b){
|
|
|
|
a.addAll(b);
|
|
|
|
return a;
|
|
|
|
}
|
2018-09-11 21:59:20 +02:00
|
|
|
|
2018-09-26 15:40:51 +02:00
|
|
|
sort(in){
|
|
|
|
var firstHalf = in;
|
|
|
|
var secondHalf = in;
|
|
|
|
return merge(sort(firstHalf), sort(secondHalf));
|
|
|
|
}
|
2018-09-11 21:59:20 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
void sort(ArrayList<String> a){
|
|
|
|
a = merge(a,a);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|