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
jacquesw.ndoumben
cours
Commits
302a62ad
Verified
Commit
302a62ad
authored
1 year ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
maj 2024
parent
822586c7
No related branches found
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_15.md
+17
-17
17 additions, 17 deletions
slides/cours_15.md
with
17 additions
and
17 deletions
slides/cours_15.md
+
17
−
17
View file @
302a62ad
...
...
@@ -94,15 +94,14 @@ $$
. . .
```
C
insert(table,
key
, val
u
e) {
index = hash
de la
clé
;
rien
insert
ion
(table,
clé
, vale
ur
) {
index = hash
(
clé
)
index =
si "index" est déjà "occupé"
et la clé correspondante n'est pas "key"
alors gérer la collision;
tant que état(table[index]) == occupé et clé(table[index]) != clé:
index = rehash(clé)
changer l'état de la case "index" à "
occupé
";
changer la valeur de la case "index" à "value";
état(table[index]) =
occupé
table[index] = valeur
}
```
...
...
@@ -113,13 +112,13 @@ insert(table, key, value) {
. . .
```
C
val
ue_t remove
(table,
key) {
index = hash
de la
clé
;
tant que
l'
état
de la case n'est pas "
vide
"
si
"index" est "
occupé
"
et
la clé est "key"
changer l'état de la case à "
supprimé
"
val
eur suppression
(table,
clé):
index = hash
(
clé
)
tant que état
(table[index]) !=
vide
:
si
état(table[index]) ==
occupé et
clé(table[index]) == clé:
état(table[index]) =
supprimé
sinon
index = rehash
index = rehash
(clé)
}
```
...
...
@@ -130,13 +129,14 @@ value_t remove(table, key) {
. . .
```
C
bool
sea
rch(table,
key, value
) {
index = hash
de la
clé
;
tant que
l'
état
de la case n'est pas "
vide
"
si
"index" est "
occupé
"
et
la clé est "key"
bool
éen reche
rch
e
(table,
clé
) {
index = hash
(
clé
)
tant que état
(table[index]) !=
vide
:
si
état(table[index]) ==
occupé et
clé(table[index]) == clé:
retourner vrai
sinon
index = rehash
retourner faux
}
```
...
...
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