Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
INF-TC1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Meng Lili
INF-TC1
Commits
38c6082e
Commit
38c6082e
authored
4 years ago
by
Romain Vuillemot
Browse files
Options
Downloads
Patches
Plain Diff
updates sujet
parent
b69c1e0a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
TD04/code/priorite.py
+10
-1
10 additions, 1 deletion
TD04/code/priorite.py
TD04/td4-correction.pdf
+0
-0
0 additions, 0 deletions
TD04/td4-correction.pdf
TD04/td4.pdf
+0
-0
0 additions, 0 deletions
TD04/td4.pdf
with
10 additions
and
1 deletion
TD04/code/priorite.py
+
10
−
1
View file @
38c6082e
from
queue
import
PriorityQueue
# initialisation de la file
file_prio
=
PriorityQueue
()
# remplissage
file_prio
.
put
((
2
,
"
Bob
"
))
file_prio
.
put
((
1
,
"
Alice
"
))
file_prio
.
put
((
6
,
"
Nat
"
))
# permet d'accéder au premier élément de la file
# (sans le supprimer)
print
(
file_prio
.
queue
[
0
])
# tant que non vide, affiche par ordre de priorité
# (mais supprimer chaque élément accédé)
while
not
file_prio
.
empty
():
print
(
file_prio
.
get
()[
1
])
\ No newline at end of file
print
(
file_prio
.
get
()[
1
])
This diff is collapsed.
Click to expand it.
TD04/td4-correction.pdf
deleted
100644 → 0
+
0
−
0
View file @
b69c1e0a
File deleted
This diff is collapsed.
Click to expand it.
TD04/td4.pdf
+
0
−
0
View file @
38c6082e
No preview for this file type
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