Skip to content

Commit

Permalink
graphs.py update
Browse files Browse the repository at this point in the history
  • Loading branch information
aymenkhs committed Mar 28, 2021
1 parent aa43e23 commit a391e26
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions results/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

best_cases = {
"insertion": lambda x: (6 * x) - 6,
"bubbles": lambda x: x,
"merge": lambda x: x,
"quick": lambda x: x,
"heap": lambda x: x * (17 * math.log2(x) - 1),
"bubbles": lambda x: (x*x + x - 2) / 2,
"merge": lambda x: x * (math.log2(x + 1) - 1),
"quick": lambda x: x + math.log2(x) * x,
"heap": lambda x: x * (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: (3 * x * (17 * math.log2(x) - 1)) / 2,
"bubbles": lambda x: (x*x + x - 2) / 2,
"merge": lambda x: 2 * (x/2) * (math.log2((x/2) + 1) - 1) + 2 * x,
"quick": lambda x: (x * (x+1)) / 2,
"heap": lambda x: (3 * x * (math.log2(x) - 1)) / 2,
}


Expand Down
Binary file modified results/graphs/comp_bestCase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/comp_worstCase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctm_Bubble Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctm_Heap Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctm_Merge Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctm_Quick Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctp_Bubble Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctp_Heap Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctp_Merge Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/graphs/ctp_Quick Sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a391e26

Please sign in to comment.