Mergesort in C++


This is my favorite sorting algorithm. It’s easy and it also can be parallelized using multiple machines / processes for huuuuge data sets.

Its runtime is (like Quicksort) O(n log(n)). Again here it’s because you split each part into two and work on it recursively.

Most fun is to think about the way Mergesort works in general and find your own implementation. Well, of course each implementation will look pretty much the same in the end…

One thought on “Mergesort in C++

Leave a Reply to Philipgap Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">