Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enonce
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
programmation_sequentielle
travaux_pratiques
c_lang
tris_multiples
enonce
Commits
a6d87c4e
Verified
Commit
a6d87c4e
authored
1 year ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
tris multiples dones?
parent
f55b8090
No related branches found
No related tags found
No related merge requests found
Pipeline
#26896
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tris_multiples.md
+17
-0
17 additions, 0 deletions
tris_multiples.md
with
17 additions
and
0 deletions
tris_multiples.md
+
17
−
0
View file @
a6d87c4e
...
...
@@ -45,5 +45,22 @@ Vous aurez plusieurs tâches.
4.
Écrire une fonction permettant de vérifier
5.
En option ajouter le tri rapide et le tri par sélection.
## Remarque
Pour le tri par base, vous devez implémenter une fonction qui retourne le
`k`
-ème bit d'un nombre
`n`
.
Pour ce faire, vous pouvez utiliser la syntaxe suivante:
```
C
(n >> k) & 1
```
où on commence par décaler tous les bits de
`n`
de
`k`
bits vers la droite, puis on fait un
`&`
-logique bit à bit
avec
`1`
(on fait un masque). Ainsi pour un nombre
`4`
-bits
```
C
n = 13 // 1101
k = 2
n >> k == 0011 // 3 en décimal
0011 & 0001 == 0001 // soit 1 en décimale
```
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