Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coursAlgo
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
yassin.elhakoun
coursAlgo
Commits
302a62ad
Verified
Commit
302a62ad
authored
1 year ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
maj 2024
parent
822586c7
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_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 @@ $$
...
@@ -94,15 +94,14 @@ $$
. . .
. . .
```
C
```
C
insert(table,
key
, val
u
e) {
rien
insert
ion
(table,
clé
, vale
ur
) {
index = hash
de la
clé
;
index = hash
(
clé
)
index =
index =
si "index" est déjà "occupé"
tant que état(table[index]) == occupé et clé(table[index]) != clé:
et la clé correspondante n'est pas "key"
index = rehash(clé)
alors gérer la collision;
changer l'état de la case "index" à "
occupé
";
état(table[index]) =
occupé
changer la valeur de la case "index" à "value";
table[index] = valeur
}
}
```
```
...
@@ -113,13 +112,13 @@ insert(table, key, value) {
...
@@ -113,13 +112,13 @@ insert(table, key, value) {
. . .
. . .
```
C
```
C
val
ue_t remove
(table,
key) {
val
eur suppression
(table,
clé):
index = hash
de la
clé
;
index = hash
(
clé
)
tant que
l'
état
de la case n'est pas "
vide
"
tant que état
(table[index]) !=
vide
:
si
"index" est "
occupé
"
et
la clé est "key"
si
état(table[index]) ==
occupé et
clé(table[index]) == clé:
changer l'état de la case à "
supprimé
"
état(table[index]) =
supprimé
sinon
sinon
index = rehash
index = rehash
(clé)
}
}
```
```
...
@@ -130,13 +129,14 @@ value_t remove(table, key) {
...
@@ -130,13 +129,14 @@ value_t remove(table, key) {
. . .
. . .
```
C
```
C
bool
sea
rch(table,
key, value
) {
bool
éen reche
rch
e
(table,
clé
) {
index = hash
de la
clé
;
index = hash
(
clé
)
tant que
l'
état
de la case n'est pas "
vide
"
tant que état
(table[index]) !=
vide
:
si
"index" est "
occupé
"
et
la clé est "key"
si
état(table[index]) ==
occupé et
clé(table[index]) == clé:
retourner vrai
retourner vrai
sinon
sinon
index = rehash
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