Forums Register Login

problems with mergeSort, help please

+Pie Number of slices to send: Send
hi, i've written a little version of merge sort. it's a little different then what i've seen but should work the same. for some reason, if the array i'm trying to sort has more then 4 values it just replaces the right half with the left half (work fine up to 4 values, weird). i've checked my merge() method several times and it's okay, and i tried debugging my sort method more then once but cuoldn't figure out my error. could it has something to do with the fact that i've used static methods?
anyway, here's the code i've written:
+Pie Number of slices to send: Send
sort doesn't modify its arguments. Therefore, at the bottom of the sort method, you ignore the actual results from the two calls to sort. I've got your code working by changing those two lines:
+Pie Number of slices to send: Send
hm
i feel stupid. thatnk you!
+Pie Number of slices to send: Send
You're welcome.
Honk if you love justice! And honk twice for tiny ads!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 721 times.
Similar Threads
Multidimensional Arrays problem
stuck in a loop
Overwriting an array.
recursive problem
Help with using mergesort to sort a list of names alphabetically?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:36:41.