Sorting Algorithms Comparison in Python
With 10000 as sample size.
Test #1
Merge sort takes 0.03125333786010742 seconds for 10000 sample
Bubble sort takes 6.654664993286133 seconds for 10000 sample
Quick sort takes 0.031239032745361328 seconds for 10000 sample
Test #2
Merge sort takes 0.01566910743713379 seconds for 10000 sample
Bubble sort takes 6.732744216918945 seconds for 10000 sample
Quick sort takes 0.03128480911254883 seconds for 10000 sample
With 25000 as sample size
Test #1
Merge sort takes 0.07817316055297852 seconds for 25000 sample
Bubble sort takes 42.13695430755615 seconds for 25000 sample
Quick sort takes 0.07811403274536133 seconds for 25000 sample
Test #2
Merge sort takes 0.06251072883605957 seconds for 25000 sample
Bubble sort takes 42.06467080116272 seconds for 25000 sample
Quick sort takes 0.0780935287475586 seconds for 25000 sample
It can be observed that both merge sort and quicksort are way faster than bubble sort.