You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
299 B
11 lines
299 B
13 years ago
|
#!/bin/bash
|
||
|
|
||
13 years ago
|
SETUP="import sorting"
|
||
|
LIST="$(python -c "import random;l = list(range(0, ${1-5000}));random.shuffle(l);print(l)")"
|
||
13 years ago
|
|
||
|
echo -n "insertion sort: "
|
||
13 years ago
|
python -m timeit -s "$SETUP" "sorting.insertion_sort($LIST)"
|
||
13 years ago
|
|
||
|
echo -n "merge sort: "
|
||
13 years ago
|
python -m timeit -s "$SETUP" "sorting.merge_sort($LIST)"
|