2.4.2 Mergesort: Bottom-Up Sortieren (nicht rekursiv)
{"Image DocumentName": "2.4.2 Mergesort: Bottom-Up Sortieren (nicht rekursiv)", "Image ImageDescription": "// procedure to get minimal element of A and B static int min(int A, int B) { return (A < B) ? A : B; } // sort a from index l to r static void mergesort(ITEM[] a, int l, int r) { // need not sort if list is empty if (r <= l) return; // global auxiliary list needed for merging in merge aux = new ITEM[a.length]; // iterate through list by blocks that are doubled each time for (int m = 1; m <= r-l; m = m+m) // iterate through each block for (int i = l; i <= r-m; i += m+m) // merge left half of block with right half merge(a, i, i+m-1, min(i+m+m-1, r)); // do not use i+m+m-1 if r is smaller // important if r-l <> 2x }", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}