Add tests for recursive merge sort (#3510)

This commit is contained in:
Thanh-Thai Tran
2022-11-12 23:10:13 +07:00
committed by GitHub
parent b294ddcb38
commit f7dee0d958
3 changed files with 72 additions and 2 deletions

View File

@ -12,9 +12,9 @@ public class MergeSortRecursive {
this.arr = arr;
}
public void mergeSort() {
public List<Integer> mergeSort() {
List<Integer> arrSorted = merge(arr);
System.out.println(arrSorted);
return arrSorted;
}
private static List<Integer> merge(List<Integer> arr) {