From bc4cbdeab0d842b1f298d9b2693be942f3f430b2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 26 Jun 2016 03:25:38 +0300 Subject: plots: update the actual plots --- plots.html | 86 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 40 deletions(-) (limited to 'plots.html') diff --git a/plots.html b/plots.html index 5addf11..30fe949 100644 --- a/plots.html +++ b/plots.html @@ -6,10 +6,10 @@ groups: navbar_link:  Plots custom_css: - plots.css -input_order: - - ascending - - random - - descending +input_kind: + - best + - average + - worst plots: - codename: bubble_sort brief_name: Bubble sort @@ -18,9 +18,9 @@ plots: max_length: 200 iterations: 100 complexity: - ascending: O(n) - random: O(n2) - descending: O(n2) + best: O(n) + average: O(n2) + worst: O(n2) - codename: bubble_sort_optimized brief_name: "… \"optimized\"" display_name: "\"Optimized\" bubble sort" @@ -28,9 +28,9 @@ plots: max_length: 200 iterations: 100 complexity: - ascending: O(n) - random: O(n2) - descending: O(n2) + best: O(n) + average: O(n2) + worst: O(n2) - codename: heapsort brief_name: Heapsort display_name: Heapsort @@ -43,20 +43,17 @@ plots: display_name: Insertion sort min_length: 0 max_length: 200 - iterations: - ascending: 1000 - random: 100 - descending: 100 + iterations: 100 complexity: - ascending: O(n) - random: O(n2) - descending: O(n2) + best: O(n) + average: O(n2) + worst: O(n2) - codename: merge_sort brief_name: Merge sort display_name: Merge sort min_length: 0 max_length: 200 - iterations: 1000 + iterations: 100 complexity: O(n log n) - codename: quicksort_first brief_name: Quicksort (first element as pivot) @@ -65,9 +62,9 @@ plots: max_length: 200 iterations: 100 complexity: - ascending: O(n2) - random: O(n log n) - descending: O(n2) + best: O(n2) + average: O(n log n) + worst: O(n2) - codename: quicksort_second brief_name: "… second element…" display_name: Quicksort (second element as pivot) @@ -75,9 +72,9 @@ plots: max_length: 200 iterations: 100 complexity: - ascending: O(n2) - random: O(n log n) - descending: O(n2) + best: O(n2) + average: O(n log n) + worst: O(n2) - codename: quicksort_middle brief_name: "… middle element…" display_name: Quicksort (middle element as pivot) @@ -92,9 +89,9 @@ plots: max_length: 200 iterations: 100 complexity: - ascending: O(n2) - random: O(n log n) - descending: O(n2) + best: O(n2) + average: O(n log n) + worst: O(n2) - codename: quicksort_random brief_name: "… random element…" display_name: Quicksort (random element as pivot) @@ -168,11 +165,11 @@ corresponding algorithm.

Algorithm - Complexity + Complexity - {% for order in page.input_order %} - {{ order }} + {% for input_kind in page.input_kind %} + {{ input_kind | capitalize }} {% endfor %} @@ -180,8 +177,13 @@ corresponding algorithm.

{% for algorithm in page.plots %} {{ algorithm.brief_name }} - {% for order in page.input_order %} - {% if algorithm.complexity[order] %}{{ algorithm.complexity[order] }}{% else %}{{ algorithm.complexity }}{% endif %} + {% for input_kind in page.input_kind %} + {% if algorithm.complexity[input_kind] %} + {% assign complexity = algorithm.complexity[input_kind] %} + {% else %} + {% assign complexity = algorithm.complexity %} + {% endif %} + {{ complexity }} {% endfor %} {% endfor %} @@ -194,22 +196,26 @@ corresponding algorithm.

{{ algorithm.display_name }}

- {% for order in page.input_order %} - {% if algorithm.iterations[order] %} - {% assign iterations = algorithm.iterations[order] %} + {% for input_kind in page.input_kind %} + {% if algorithm.iterations[input_kind] %} + {% assign iterations = algorithm.iterations[input_kind] %} {% else %} {% assign iterations = algorithm.iterations %} {% endif %} - {% capture stem %}{{ algorithm.codename }}_{{ iterations }}_{{ order }}_{{ algorithm.min_length }}_{{ algorithm.max_length }}{% endcapture %} + {% if algorithm.complexity[input_kind] %} + {% assign complexity = algorithm.complexity[input_kind] %} + {% else %} + {% assign complexity = algorithm.complexity %} + {% endif %} + {% capture stem %}{{ algorithm.codename }}_{{ iterations }}_{{ input_kind }}_{{ algorithm.min_length }}_{{ algorithm.max_length }}{% endcapture %}
- {{ algorithm.display_name | escape }}, {{ iterations }} iterations, {{ order }} input + {{ algorithm.display_name | escape }}, {{ iterations }} iterations, {{ input_kind }} case
- {{ algorithm.display_name }}
- Input: {{ order }}
- Complexity: {% if algorithm.complexity[order] %}{{ algorithm.complexity[order] }}{% else %}{{ algorithm.complexity }}{% endif %}
+ {{ algorithm.display_name }},
+ {{ input_kind }} case, {{ complexity }}
-- cgit v1.2.3