![]() |
|
#1
|
|||
|
|||
Merge sort on a linked listI'm fairly new at C++ (but not programming). I'm trying to do a merge sort on a linked list (I wrote). The linked list works just fine (I can print it out unsorted and add objects just fine). I wrote a merge sort in Java that works just fine.
Here's the working code for the Java merge sort: JAVA Code:
What I did was copy the code from this and change the syntax to C++. The first time I did, it compiled but I was passing things by value so when I returned from the recursion none of the changes were saved. So I went through and changed things so they passed by reference instead. But this code has a few return type errors: CPP / C++ / C Code:
So my question is how do I fix the return type errors and make sure that I am actually changing the pointers in the list and not just copies of them? Any help would be greatly appriciated. |
|
#2
|
|||
|
|||
Re: Merge sort on a linked listWhat is your logic of this program ?
Thanks. __________________
Linux is the best OS in the world. |
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The