Skip to content

Commit

Permalink
divided test data by 100 and added the time complexity of the heap sort
Browse files Browse the repository at this point in the history
  • Loading branch information
aymenkhs committed Mar 17, 2021
1 parent 02055c1 commit 5b19c72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ int main(){
int (* fonctions [5])(long*, long) = {insertionSort, bubbleSort, mergeSort, quickSort, heapSort};

long *tab = NULL;
long debut = 50000, fin = 204800000;
long debut = 500, fin = 2048000;
int taille;
tab = generer_tailles_tableaux(debut, fin, &taille);

for (int i = 0; i < 5; i++) {

printf("%s started.\n", function_names[i]);
Expand Down
6 changes: 3 additions & 3 deletions results/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"bubbles": lambda x: x,
"merge": lambda x: x,
"quick": lambda x: x,
"heap": lambda x: x,
"heap": lambda x: x * (17 * math.log2(x) - 1),
}

worst_cases = {
"insertion": lambda x: (x * (x - 1)) / 2,
"bubbles": lambda x: x,
"merge": lambda x: x,
"quick": lambda x: x,
"heap": lambda x: x,
"heap": lambda x: (3 * x * (17 * math.log2(x) - 1)) / 2,
}

def create_hue_data(initial_data, fusion=3):
Expand All @@ -49,7 +49,7 @@ def create_hue_data(initial_data, fusion=3):
return hue_data


def graph_langage(data, type, langage, min_values=50000, max_values=204800000):
def graph_langage(data, type, langage, min_values=500, max_values=2048000):
hue_data = create_hue_data(data)
ax = sns.lineplot(data=hue_data, x="n", y="temps d'execution", hue="Partie")
ax.legend(["données deja ordonner", "données ordre inverse", "données aleatoires"])
Expand Down

0 comments on commit 5b19c72

Please sign in to comment.