Created
May 26, 2020 08:02
-
-
Save BMU-Verlag/340c8780fa0396bb7d0d12e7c4c7f128 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
int teilen (int liste[], int links, int rechts) | |
{ | |
int tauschwert; | |
int trenner = liste[rechts]; | |
int i = links - 1; | |
for (int j = links; j <= rechts - 1; j++) | |
{ | |
if (liste[j] < trenner) | |
{ | |
i++; | |
tauschwert = liste[i]; | |
liste[i] = liste[j]; | |
liste[j] = tauschwert; | |
} | |
} | |
tauschwert = liste[i + 1]; | |
liste[i + 1] = liste[rechts]; | |
liste[rechts] = tauschwert; | |
return (i + 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment