Why Sorting?
I started learning Golang last week and to solidify my understanding of the syntax, I practiced using Leetcode. This led me...
For further actions, you may consider blocking this person and/or reporting abuse
so, the first thing here is the order of growth, bubble sort grows quadratically, where as merge sort has n*log(n). as n becomes large,
(taking limit), n^2 grows faster than n*log(n), but this is just an upperbound / asymptotic analysis, which is done after ignoring the lower order terms, constants and other external factors such as compiler optimizations, and hardware configs. intuitively it feels (atleast for me) that for smaller array sizes, the instrcutions needed for swapping elements are must faster than loading the recursive stack back and forth into memory.
Yep, agree with ur thought 🙌.
Thanks for Commenting ❤️