This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A[] = { 28, 39, 48, 27, 9, 88, 11, 4, 7} // Global variable, disregard bad programming practices | |
Function Split(int low, int hi){ // Adding brackets because not only am I used to java, it should help readability | |
if (hi - low) < 2 then | |
return array of elements from [low, hi] | |
mid = (hi + low) / 2 | |
B[] = split(low, mid-1) // Either I do mid-1 or mid+1, the results seem the same | |
C[] = split(mid, hi) // Same problems as above | |
D[] = Merge(B[], C[]) | |
return D[] |
NewerOlder