aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/plot_all.sh
blob: 9e216fe661957aec9bf7774e6735fba1f97c4070 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash

# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com>                        
# This file is part of the "Sorting algorithms" project.                                
# For details, see https://github.com/egor-tensin/sorting-algorithms.                   
# Distributed under the MIT License.

set -o errexit -o nounset -o pipefail
shopt -s inherit_errexit lastpipe

script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
script_dir="$( cd -- "$script_dir" && pwd )"
readonly script_dir

declare -a algorithm_list=(
    bubble_sort
    bubble_sort_optimized
    heapsort
    insertion_sort
    merge_sort
    quicksort_first
    quicksort_last
    quicksort_middle
    quicksort_random
    quicksort_second
    selection_sort
)

main() {
    local algorithm
    for algorithm in ${algorithm_list[@]+"${algorithm_list[@]}"}; do
        echo "Plotting algorithm $algorithm..."
        "$script_dir/plot.sh" "$algorithm"
    done
}

main "$@"