用Java实现归并排序算法

import java.util.Arrays;
public class MergeSort {
    public static void main(String[] args) {
        int[] arr1 = {4,2,6,3,5};
        System.out.println(Arrays.toString(arr1));
        mergeSort(arr1,0,arr1.length-1);
        System.out.println(Arrays.toString(arr1));
    }

    public static void mergeSort(int[] arr,int l,int r) {
        //0 4
        if (l

你可能感兴趣的:(用Java实现归并排序算法)