Merge sort is arguably the most popular divide and conquer algorithm, It is one of the first algorithms any software engineer learns while learning...
For further actions, you may consider blocking this person and/or reporting abuse
Man, your
mergehas very poor performance, because you are cloning the whole array twice inside a recursive function! Everymergecall, even the ones with only one element on each side, will clone the whole array twice... You could try to make it in-place, just swapping elements.Also, it is written like in C, it could be very improved using Rust constructs, like iterators, slices, and some trait magic.
Here it is one that's very good: dev.to/creativcoder/merge-k-sorted...
I specially like the one in the comments.
Hey, Thanks a lot for sharing the article, I'm still exploring Rust plus learning other things. I'm familiar with C so I was sort of seeing how it would be implemented in Rust Syntax.