Created
May 9, 2020 15:46
-
-
Save smspillaz/f2049694eb847604e36cd6ffc218086f to your computer and use it in GitHub Desktop.
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
void inplace_merge(int *first, int *mid, int *end) { | |
int *datacopy[size of data]; | |
int *left = first; | |
int *right = end; | |
int next = 0; | |
int n = end - first; | |
while (next < n) { | |
if (left < mid && *left < *right) { | |
datacopy[next++] = *left; | |
} else if (right < end) { | |
datacopy[next++] = *right; | |
} | |
} | |
/* Copy datacopy to first, no idea how inplace_merge works in practice lol */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment