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

corrected typos

parent ab66b640
Branches
No related tags found
No related merge requests found
--- ---
title: "Tris et backtracking" title: "Tris et backtracking"
date: "2021-11-12" date: "2021-11-10"
patat: patat:
eval: eval:
tai: tai:
...@@ -140,7 +140,7 @@ int low, high; // les indices min/max des tableaux à trier ...@@ -140,7 +140,7 @@ int low, high; // les indices min/max des tableaux à trier
```C ```C
void quicksort(array, low, high) { void quicksort(array, low, high) {
if (less than 2 elems) { if (more than 2 elems) {
pivot_ind = partition(array, low, high); pivot_ind = partition(array, low, high);
if (something left of pivot) if (something left of pivot)
quicksort(array, low, pivot_ind - 1); quicksort(array, low, pivot_ind - 1);
...@@ -157,8 +157,8 @@ void quicksort(array, low, high) { ...@@ -157,8 +157,8 @@ void quicksort(array, low, high) {
```C ```C
int partition(array, low, high) { int partition(array, low, high) {
pivot = array[high]; // choix arbitraire pivot = array[high]; // choix arbitraire
i = first - 1; i = low;
j = last; j = high-1;
while i < j { while i < j {
en remontant i trouver le premier élément > pivot; en remontant i trouver le premier élément > pivot;
en descendant j trouver le premier élément < pivot; en descendant j trouver le premier élément < pivot;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment