Skip to content
Snippets Groups Projects
Verified Commit 59b04528 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

corrected typos

parent 2d1a3557
Branches
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ entier ind_min, ind_max; // les indices min/max des tableaux à trier
```python
rien quicksort(entier tableau[], entier ind_min, entier ind_max)
si (longueur(tab) > 1)
ind_pivot = partition(array, ind_min, ind_max)
ind_pivot = partition(tableau, ind_min, ind_max)
si (longueur(tableau[0:ind_pivot-1]) != 0)
quicksort(tableau, ind_min, pivot_ind - 1)
si (longueur(tableau[ind_pivot+1:ind_max-1]) != 0)
......@@ -189,18 +189,18 @@ rien quicksort(entier tableau[], entier ind_min, entier ind_max)
```C
entier partition(entier tableau[], entier ind_min, entier ind_max)
pivot = array[ind_max]; // choix arbitraire
pivot = tableau[ind_max]; // choix arbitraire
i = ind_min;
j = ind_max-1;
tant que i < j:
en remontant i trouver le premier élément > pivot
en descendant j trouver le premier élément < pivot
échanger(array[i], array[j])
échanger(tableau[i], tableau[j])
// les plus grands à droite
// mettre les plus petits à gauche
// on met le pivot "au milieu"
échanger(array[i], array[pivot]);
échanger(tableau[i], tableau[pivot]);
retourne i; // on retourne l'indice pivot
}
```
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment