From 230f4b6be1240ccd81b92bb13c1fe679cf77d0c4 Mon Sep 17 00:00:00 2001 From: Orestis <orestis.malaspinas@pm.me> Date: Wed, 10 Nov 2021 10:13:19 +0100 Subject: [PATCH] corrected typos --- slides/cours_7.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slides/cours_7.md b/slides/cours_7.md index 970d5da..5d9e4ea 100644 --- a/slides/cours_7.md +++ b/slides/cours_7.md @@ -1,6 +1,6 @@ --- title: "Tris et backtracking" -date: "2021-11-12" +date: "2021-11-10" patat: eval: tai: @@ -140,7 +140,7 @@ int low, high; // les indices min/max des tableaux à trier ```C void quicksort(array, low, high) { - if (less than 2 elems) { + if (more than 2 elems) { pivot_ind = partition(array, low, high); if (something left of pivot) quicksort(array, low, pivot_ind - 1); @@ -157,8 +157,8 @@ void quicksort(array, low, high) { ```C int partition(array, low, high) { pivot = array[high]; // choix arbitraire - i = first - 1; - j = last; + i = low; + j = high-1; while i < j { en remontant i trouver le premier élément > pivot; en descendant j trouver le premier élément < pivot; -- GitLab