Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tp2 Groupe1
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
Simon Lecocq
Tp2 Groupe1
Commits
8437b4f3
Commit
8437b4f3
authored
3 months ago
by
Simon Lecocq
Browse files
Options
Downloads
Patches
Plain Diff
Finished question10
parent
3b2c7f10
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Plot1.png
+0
-0
0 additions, 0 deletions
Plot1.png
Plot2.png
+0
-0
0 additions, 0 deletions
Plot2.png
Plot3.png
+0
-0
0 additions, 0 deletions
Plot3.png
histogramme.png
+0
-0
0 additions, 0 deletions
histogramme.png
tp_2_miso_dict.py
+3
-3
3 additions, 3 deletions
tp_2_miso_dict.py
with
3 additions
and
3 deletions
Plot1.png
0 → 100644
+
0
−
0
View file @
8437b4f3
21.7 KiB
This diff is collapsed.
Click to expand it.
Plot2.png
0 → 100644
+
0
−
0
View file @
8437b4f3
21 KiB
This diff is collapsed.
Click to expand it.
Plot3.png
0 → 100644
+
0
−
0
View file @
8437b4f3
22.3 KiB
This diff is collapsed.
Click to expand it.
histogramme.png
0 → 100644
+
0
−
0
View file @
8437b4f3
20.9 KiB
This diff is collapsed.
Click to expand it.
tp_2_miso_dict.py
+
3
−
3
View file @
8437b4f3
...
@@ -17,10 +17,10 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list
...
@@ -17,10 +17,10 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list
memory_sizes
=
[]
memory_sizes
=
[]
for
i
in
load_factors
:
for
i
in
load_factors
:
d
=
{}
d
=
{}
start_time
=
time
.
perf_counter
()
resizing_count
=
0
resizing_count
=
0
last_memory_size
=
sys
.
getsizeof
(
d
)
last_memory_size
=
sys
.
getsizeof
(
d
)
num_elements
=
int
(
i
*
100
)
num_elements
=
int
(
i
*
100
)
start_time
=
time
.
perf_counter
()
for
j
in
range
(
num_elements
):
for
j
in
range
(
num_elements
):
d
[
j
]
=
j
d
[
j
]
=
j
current_memory_size
=
sys
.
getsizeof
(
d
)
current_memory_size
=
sys
.
getsizeof
(
d
)
...
@@ -28,7 +28,7 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list
...
@@ -28,7 +28,7 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list
resizing_count
+=
1
resizing_count
+=
1
last_memory_size
=
current_memory_size
last_memory_size
=
current_memory_size
end_time
=
time
.
perf_counter
()
end_time
=
time
.
perf_counter
()
insertion_times
.
append
(
end_time
-
start_time
)
insertion_times
.
append
(
end_time
-
start_time
)
resizing
.
append
(
resizing_count
)
resizing
.
append
(
resizing_count
)
memory_sizes
.
append
(
last_memory_size
)
memory_sizes
.
append
(
last_memory_size
)
return
insertion_times
,
resizing
,
memory_sizes
return
insertion_times
,
resizing
,
memory_sizes
...
@@ -77,7 +77,7 @@ def visualisation(load_factors, insertion_times, num_resizes, sizes, frequencies
...
@@ -77,7 +77,7 @@ def visualisation(load_factors, insertion_times, num_resizes, sizes, frequencies
plt
.
title
(
'
Taille de mémoire occupée en fonction du nombre d
\'
éléments
'
)
plt
.
title
(
'
Taille de mémoire occupée en fonction du nombre d
\'
éléments
'
)
plt
.
savefig
(
'
Plot3.png
'
)
plt
.
savefig
(
'
Plot3.png
'
)
# Deuxième étude
# Deuxième étude
f
=
list
()
f
=
frequencies
plt
.
figure
(
figsize
=
(
10
,
6
))
plt
.
figure
(
figsize
=
(
10
,
6
))
plt
.
bar
(
range
(
len
(
f
)),
f
)
plt
.
bar
(
range
(
len
(
f
)),
f
)
plt
.
xlabel
(
'
Temps d
\'
insertion (s)
'
)
plt
.
xlabel
(
'
Temps d
\'
insertion (s)
'
)
...
...
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