private int[] a; private int[] b; // Hilfsarray private int n; public void sort(int[] a) { this.a=a; n=a.length; // je nach Variante entweder/oder: b=new int[(n+1)/2]; b=new int[n]; mergesort(0, n-1); } private void mergesort(int lo, int hi) { if (lo
int[] a = new int[]{5,4,8,2,1,6,2,12,34}; sort(a); for(int i = 0 ; i < a.length ; i++){ System.out.print(a[i] + " "); }
ausführen