Hello everybody,
was wondering which would be the appropriate approach
to merge and sort 2 filled arrays (ints).
I have tried to implement a merge sort..
but am wondering if this is the correct approach..
Thanks alot
Mouse
Hello everybody,
was wondering which would be the appropriate approach
to merge and sort 2 filled arrays (ints).
I have tried to implement a merge sort..
but am wondering if this is the correct approach..
Thanks alot
Mouse
Sort both lists (if they aren't already) and merge the lists together to make a single sorted list.
Merge sort doesn't typically take 2 arrays as its input. The name of the algorithm comes from its divide-and-conquer (recursive) strategy, which is to split the array to be sorted in half, sort each half, and merge them back together.
The "merge them back together" part of the algorithm, you can use once you're two lists are sorted. You can use whatever sorting algorithm you like to sort your two lists before you merge them together.
merge sort
gg