Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created May 26, 2020 08:02
Show Gist options
  • Save BMU-Verlag/340c8780fa0396bb7d0d12e7c4c7f128 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/340c8780fa0396bb7d0d12e7c4c7f128 to your computer and use it in GitHub Desktop.
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