diff --git a/Plot1.png b/Plot1.png new file mode 100644 index 0000000000000000000000000000000000000000..a1c1d4cec10cfa2f38ef34a88bb873d0fc6b5fb6 Binary files /dev/null and b/Plot1.png differ diff --git a/Plot2.png b/Plot2.png new file mode 100644 index 0000000000000000000000000000000000000000..cc31e1959376a1ef657e83da8d65180c8eb3b7e0 Binary files /dev/null and b/Plot2.png differ diff --git a/Plot3.png b/Plot3.png new file mode 100644 index 0000000000000000000000000000000000000000..ca70e82873aabd2b2599f19a00ee471419aad8ca Binary files /dev/null and b/Plot3.png differ diff --git a/histogramme.png b/histogramme.png new file mode 100644 index 0000000000000000000000000000000000000000..bca48cb0dfd8ecc0fde461c3cfa0440267349d36 Binary files /dev/null and b/histogramme.png differ diff --git a/tp_2_miso_dict.py b/tp_2_miso_dict.py index 693142ef647aae84c366bf47ff85f86e888880f6..b574153552dcc4b817aff676846203664a33d522 100644 --- a/tp_2_miso_dict.py +++ b/tp_2_miso_dict.py @@ -17,10 +17,10 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list memory_sizes = [] for i in load_factors: d = {} - start_time = time.perf_counter() resizing_count = 0 last_memory_size = sys.getsizeof(d) num_elements = int(i*100) + start_time = time.perf_counter() for j in range(num_elements): d[j] = j current_memory_size = sys.getsizeof(d) @@ -28,7 +28,7 @@ def experiment_load_factor(load_factors: list[float]) -> tuple[list[float], list resizing_count += 1 last_memory_size = current_memory_size end_time = time.perf_counter() - insertion_times.append( end_time - start_time) + insertion_times.append(end_time - start_time) resizing.append(resizing_count) memory_sizes.append(last_memory_size) return insertion_times, resizing, memory_sizes @@ -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.savefig('Plot3.png') # Deuxième étude - f = list() + f = frequencies plt.figure(figsize=(10, 6)) plt.bar(range(len(f)), f) plt.xlabel('Temps d\'insertion (s)')