eacc351b17
git-subtree-dir: PracticingAlgorithms git-subtree-mainline:0a9428093c
git-subtree-split:0b723f2ae0
11 lines
299 B
Bash
Executable File
11 lines
299 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SETUP="import sorting"
|
|
LIST="$(python -c "import random;l = list(range(0, ${1-5000}));random.shuffle(l);print(l)")"
|
|
|
|
echo -n "insertion sort: "
|
|
python -m timeit -s "$SETUP" "sorting.insertion_sort($LIST)"
|
|
|
|
echo -n "merge sort: "
|
|
python -m timeit -s "$SETUP" "sorting.merge_sort($LIST)"
|