![]() |
|
#1
|
|||
|
|||
linked lists selection and insertion sortBelow is the code for my linked list. I've tried to create a selection sort on the user's inputted numbers. Is the code I wrote correct for a selection sort?
After I get the selection sort working properly, I will try to implement the insertion sort. I'm sure its not too difficult, but I'm sure I will need help. Thanks in advance. CPP / C++ / C Code:
Last edited by LuciWiz : 26-Jun-2006 at 23:57.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|
#2
|
||||
|
||||
Re: linked lists selection and insertion sortYou should define a default constructor, and eliminate the create function. Also add an insert function, and put the loop for inserting numbers outside the class.
You also need to define a destructor, or you will have a memory leak. |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The