aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/index.html
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-06 22:22:01 +0200
committerEgor Tensin <egor@tensin.name>2026-06-06 22:24:33 +0200
commitc0923664214655a439d0d9df41a52b8936d3b43d (patch)
treea6fb587447f522fed09733f1556d1fc2a3c564ff /src/index.html
parentbump dependencies (diff)
downloadsorting-algorithms-c0923664214655a439d0d9df41a52b8936d3b43d.tar.gz
sorting-algorithms-c0923664214655a439d0d9df41a52b8936d3b43d.zip
move Jekyll source files to src/
Diffstat (limited to 'src/index.html')
-rw-r--r--src/index.html228
1 files changed, 228 insertions, 0 deletions
diff --git a/src/index.html b/src/index.html
new file mode 100644
index 0000000..20c8386
--- /dev/null
+++ b/src/index.html
@@ -0,0 +1,228 @@
+---
+title: Main page
+layout: plain
+navbar:
+ link: Project
+links:
+ - {rel: stylesheet, href: assets/css/plots.css}
+input_kind:
+ - best
+ - average
+ - worst
+plots:
+ - codename: bubble_sort
+ brief_name: Bubble sort
+ display_name: Bubble sort
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var>)
+ average: O(<var>n</var><sup>2</sup>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: bubble_sort_optimized
+ brief_name: "&hellip; \"optimized\""
+ display_name: "\"Optimized\" bubble sort"
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var>)
+ average: O(<var>n</var><sup>2</sup>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: heapsort
+ brief_name: Heapsort
+ display_name: Heapsort
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity: O(<var>n</var> log <var>n</var>)
+ - codename: insertion_sort
+ brief_name: Insertion sort
+ display_name: Insertion sort
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var>)
+ average: O(<var>n</var><sup>2</sup>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: merge_sort
+ brief_name: Merge sort
+ display_name: Merge sort
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity: O(<var>n</var> log <var>n</var>)
+ - codename: quicksort_first
+ brief_name: Quicksort (first element as pivot)
+ display_name: Quicksort (first element as pivot)
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var><sup>2</sup>)
+ average: O(<var>n</var> log <var>n</var>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: quicksort_second
+ brief_name: "&hellip; second element&hellip;"
+ display_name: Quicksort (second element as pivot)
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var><sup>2</sup>)
+ average: O(<var>n</var> log <var>n</var>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: quicksort_middle
+ brief_name: "&hellip; middle element&hellip;"
+ display_name: Quicksort (middle element as pivot)
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity: O(<var>n</var> log <var>n</var>)
+ - codename: quicksort_last
+ brief_name: "&hellip; last element&hellip;"
+ display_name: Quicksort (last element as pivot)
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity:
+ best: O(<var>n</var><sup>2</sup>)
+ average: O(<var>n</var> log <var>n</var>)
+ worst: O(<var>n</var><sup>2</sup>)
+ - codename: quicksort_random
+ brief_name: "&hellip; random element&hellip;"
+ display_name: Quicksort (random element as pivot)
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity: O(<var>n</var> log <var>n</var>)
+ - codename: selection_sort
+ brief_name: Selection sort
+ display_name: Selection sort
+ min_length: 0
+ max_length: 200
+ iterations: 100
+ complexity: O(<var>n</var><sup>2</sup>)
+---
+<h1>{{ site.settings.project.name }}</h1>
+
+<div class="row">
+ <div class="col-xs-12 col-sm-10 col-md-8">
+ <p class="text-muted">The goals of this "project" include a) familiarizing
+myself with a few sorting algorithms by examining their (possibly, simplified)
+implementations and b) studying the way algorithm's running time changes in
+relation to the length of its input (a.k.a. identifying its time
+complexity).</p>
+ <p class="text-muted">A simple way to visualize the way algorithm's running
+time changes is to make appropriate measurements and plot them on a nice graph.
+The results of course are highly dependent on the hardware used, while the
+graph's look depends on the software used for rendering.</p>
+ <p class="text-muted">Both the hardware &amp; the software that were used
+to produce the plots are listed below.</p>
+ <table class="table table-bordered wide-enough">
+ <tr>
+ <th>CPU</th>
+ <td><a href="https://www.amd.com/en/support/downloads/drivers.html/processors/ryzen/ryzen-5000-series/amd-ryzen-7-5700x.html">AMD Ryzen 7 5700X</a></td>
+ </tr>
+ <tr>
+ <th>OS</th>
+ <td>Linux 6.12</td>
+ </tr>
+ <tr>
+ <th>CPython</th>
+ <td>3.14.2</td>
+ </tr>
+ <tr>
+ <th>matplotlib</th>
+ <td>3.10.8</td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+{% if page.plots and page.plots != empty %}
+<div class="row">
+ <div class="col-xs-12 col-sm-10 col-md-8">
+ <p>The table &amp; plots below are just an attempt to nicely lay out the
+data generated using the code from the project repository's <code>master</code>
+branch.
+Visit <a href="{{ site.github.repository_url }}">{{ site.github.repository_url }}</a> for more details.</p>
+
+ <p>Each of the implemented algorithms was provided with three input
+sequences:</p>
+ <ul>
+ <li>a list of <var>n</var> consecutive numbers sorted in ascending order,</li>
+ <li>&hellip; in descending order,</li>
+ <li>&hellip; in random order.</li>
+ </ul>
+ <p>Use the table below to quickly navigate to the plots for the
+corresponding algorithm.</p>
+
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th class="text-center" rowspan="2">Algorithm</th>
+ <th class="text-center" colspan="{{ page.input_kind.size }}">Complexity</th>
+ </tr>
+ <tr>
+ {% for input_kind in page.input_kind %}
+ <th class="text-center">{{ input_kind | capitalize }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+{% for algorithm in page.plots %}
+<tr>
+ <td><a href="#{{ algorithm.codename }}">{{ algorithm.brief_name }}</a></td>
+ {% for input_kind in page.input_kind %}
+ {% if algorithm.complexity[input_kind] %}
+ {% assign complexity = algorithm.complexity[input_kind] %}
+ {% else %}
+ {% assign complexity = algorithm.complexity %}
+ {% endif %}
+ <td>{{ complexity }}</td>
+ {% endfor %}
+</tr>
+{% endfor %}
+ </tbody>
+ </table>
+ </div>
+</div>
+
+{% for algorithm in page.plots %}
+<a id="{{ algorithm.codename }}"></a>
+<h3>{{ algorithm.display_name }}</h3>
+<div class="row">
+ {% for input_kind in page.input_kind %}
+ {% if algorithm.iterations[input_kind] %}
+ {% assign iterations = algorithm.iterations[input_kind] %}
+ {% else %}
+ {% assign iterations = algorithm.iterations %}
+ {% endif %}
+ {% 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 %}
+ <div class="col-xs-12 col-sm-6 col-md-4">
+ <div class="thumbnail">
+ <a class="thumbnail" href="{{ site.baseurl }}/assets/img/plots/full_size/{{ stem }}.png">
+ <img class="img-responsive" src="{{ site.baseurl }}/assets/img/plots/preview/{{ stem }}.png" alt="{{ algorithm.display_name | escape }}, {{ iterations }} iterations, {{ input_kind }} case"/>
+ </a>
+ <div class="caption">
+ <strong>{{ algorithm.display_name }}</strong><br/>
+ {{ input_kind | capitalize }} case, {{ complexity }}
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+</div>
+{% endfor %}
+
+{% else %}
+<p class="h3">Sorry, no plots have been added yet.</p>
+<hr/>
+{% endif %}