The recursive function to do merge sort in the previous attached should be ok. I found a non-recursive one to do the same, see mergeSort_nonRecursive() in attached. Not so sure which one works faster. Personally I prefer non-recursive implementation since it is easier to read. Let me know what you think.
↧