Add 'PracticingAlgorithms/' from commit '0b723f2ae0a20ab8c90c33db8c1d9d9acd76a86f'

git-subtree-dir: PracticingAlgorithms
git-subtree-mainline: 0a9428093c
git-subtree-split: 0b723f2ae0
This commit is contained in:
Dan Buch
2013-01-09 23:58:26 -05:00
11 changed files with 247 additions and 0 deletions

10
PracticingAlgorithms/bench Executable file
View File

@@ -0,0 +1,10 @@
#!/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)"