Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Programming Languages
Java
How to sort a CSV file with merge sort JAVA
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="CodeMonkeyJ, post: 5168516, member: 86802"] That won't even compile, the `a` array is missing a definition. But, had it compiled, you'd just need to change where it's getting the int array in the methods: [CODE]static void mergeSort(Metoxh[] arrayToSort, int lowerIndex, int upperIndex) { and private static void merge(Metoxh[] arrayToSort, int lowerIndexPointer[/CODE] and where it's actually making the comparison, which is only: [CODE] if(a[lowerIndex] < a[higherIndex]) { to if(a[lowerIndex].marks < a[higherIndex].marks) { [/CODE] I tried to make it work by creating `a` as a clone of the input, but that didn't really pan out. So, you'll have to figure out what `a` is actually supposed to be or maybe the implementation is off. Either way, the way you'd modify any implementation should be the same: change where it accepts the array as input and change where it actually uses the values. [/QUOTE]
Verification
Post reply
Forums
Programming Languages
Java
How to sort a CSV file with merge sort JAVA
Top