Quantcast
Channel: Muharem Hrnjadovic » functional programming
Viewing all articles
Browse latest Browse all 4

Wrap-up: mergesort in haskell

$
0
0

I have to admit that I didn’t fully understand the apfelmus example code. Nevertheless, I made an effort to address both of his criticisms:

  1. The merge() function does not use an accumulator argument any more and is indeed much simpler now.
  2. The recursive mergesort_ function now does not use the haskell list length operator any more. Instead, the length of the list to be sorted is passed down the recursive chain.

Please see the optimised mergesort implementation for details.

These improvements reduced the RAM utilisation and improved the run-time performance by another 20% respectively.

Nothing to scoff at, eh?



Viewing all articles
Browse latest Browse all 4

Trending Articles