Quote:
Originally Posted by suzzer99
So the point isn't to divide and conquer and run tasks in parallel but to get the n steps down?
How does this differ from the famed bubble sort I've heard happens at every interview? Is there a nice Marge-like graphic of bubble sort for easily distracted visual learners like me?
The point is divide and conquer to get the time complexity down.
Bubble sort is n^2. In bubble sort you put one more item in place each pass but you also get some things closer to the right spot. There are some youtubes of bubble sort in action you'll like.
Mergesort's n*log(n) is much better time than n^2. Merge sort requires allocating which makes it take up O(n) space, sometimes undesirable.
I think being able to quickly implement quicksort, heapsort, mergesort in your favorite language has some interview value.