All four algorithms sort the same shuffled array, simultaneously, at the same speed. Watch O(n²) algorithms get lapped by O(n log n) in real time.
O(n²) O(n²) O(n log n) O(n log n) These algorithms compare each element against many others. For 30 items they might make ~450 comparisons. Double the array to 60 items and comparisons quadruple to ~1,800. They're fine for small or nearly-sorted arrays, but slow down badly as data grows.
These use divide-and-conquer — split the problem in half, solve each half, combine. For 30 items: roughly 150 operations. For 60 items: roughly 354 — less than double, not quadruple. The gap widens dramatically with larger data.
"Merge sort has a time complexity of O(n log n) which is more efficient than bubble sort's O(n²) for large datasets, as the number of comparisons grows much more slowly as n increases."
Merge sort requires O(n) extra space for the temporary arrays during merging. Bubble and insertion sort are in-place (O(1) extra space). Quick sort is also in-place on average, though worst-case is O(n) stack depth.