归并排序
2021-03-26 21:29
标签:ext import scanner system util ring can next 排序 归并排序 标签:ext import scanner system util ring can next 排序 原文地址:https://blog.51cto.com/tianyiya/2533739
import java.util.Scanner;
public class Main {
public static void sort(int [] arr,int left,int right) {
if (left >= right) {
return;
}
int m = (left + right) >>> 1;
sort(arr, left, m);
sort(arr, m + 1, right);
int[] tmp = new int[right - left + 1];
int i = left, j = m + 1, index = 0;
while (i