Various implementations of merge sort