Why is my MergeSort so slow in Python?

前端 未结 4 1901
春和景丽
春和景丽 2021-01-14 15:20

I\'m having some troubles understanding this behaviour. I\'m measuring the execution time with the timeit-module and get the following results for 10000 cyc

4条回答
  •  攒了一身酷
    2021-01-14 15:55

    Your merge-sort has a big constant factor, you have to run it on large lists to see the asymptotic complexity benefit.

提交回复
热议问题