Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
radhwan.hassine
cours
Commits
34545a1a
Commit
34545a1a
authored
3 years ago
by
paul.albuquer
Browse files
Options
Downloads
Patches
Plain Diff
typo errors, quisort => quicksort
parent
9031598f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/cours_7.md
+5
-5
5 additions, 5 deletions
slides/cours_7.md
with
5 additions
and
5 deletions
slides/cours_7.md
+
5
−
5
View file @
34545a1a
...
...
@@ -38,8 +38,8 @@ triés du tableau.
```
C
void tri_insertion(int size, int tab[size]) {
for (int i = 1; i < size; i++) {
int pos = i;
int tmp = tab[i];
int pos = i;
while (pos > 0 && tab[pos - 1] > tmp) {
tab[pos] = tab[pos - 1];
pos = pos - 1;
...
...
@@ -106,8 +106,8 @@ void tri_insertion(int size, int tab[size]) {
1.
Choisir le pivot et l'amener à sa place:
*
Les éléments à gauche sont plus petits que le pivot.
*
Les éléments à droite sont plus grand que le pivot.
2.
`quisort(tableau_gauche)`
en omettant le pivot.
3.
`quisort(tableau_droite)`
en omettant le pivot.
2.
`qui
ck
sort(tableau_gauche)`
en omettant le pivot.
3.
`qui
ck
sort(tableau_droite)`
en omettant le pivot.
4.
S'il y a moins de deux éléments dans le tableau, le tableau est trié.
. . .
...
...
@@ -180,7 +180,7 @@ int partition(array, low, high) {
```
C
void quicksort(int size, int array[size], int first,
int last)
int last)
{
if (first < last) {
int midpoint = partition(size, array, first, last);
...
...
@@ -328,7 +328,7 @@ $$
## Exercice *sur papier*
*
Trier par tri à bulles le tableau
`[5, -2, 1, 3, 10]`
*
Trier par tri à bulles le tableau
`[5, -2, 1, 3, 10
, 15, 7, 4
]`
```
C
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment