so wrong....

I finally watched the solution video for the quicksort I've been thrashing my head on for two weeks.....  What I'm trying to do..... might not be possible.....

The way the solution is done for class is by simply swapping out the data values... Not the nodes at all..... I was trying to swap out the entire nodes....   Nice to know.  Wondering if what I am trying to do is still possible.  Not even sure.

I could scream.  I could have had this information weeks ago.... but it's my own fault.

Is it worth it to keep trying?  If no one does it this way, is it even worth it???? What would be the purpose other then doing something I can't seem to find anyone else doing? 

If I have a doubly linked list,  and it has a data value that is an integer... and three other datas that are not... names, status, locations ..  and I sort the list by the data values the way that the given solution is....  then the nodes contain data that are not matched to the data value. Sure, the list is now sorted in data values... but the nodes contents are still in the original order, and the data values mean nothing...  What was the point in sorting them???

Going to try sorting the data, then rebuilding the list by order of the data.  So will have to store the original list in some way, and not alter it,  Alter the temporary version,  rebuild the newlist based on the temporary list,  using the original nodes....  I have the 'push_node()'.....  I just can't see another way.

I'm going to keep plugging away.  It just makes sense you'd want to sort the whole node... Not just one integer value attached to it....  At least now I know that I haven't been melting my brain because I wasn't seeing something because I was stupid.  I was just trying to solve something that was a bigger problem then I was given.   

Why over complicate things?  Eh....  It's a habit.  And if it weren't for those damned gremlins I'd be a lonely lump of spam. 

Comments

Popular posts from this blog

playing with color in powershell python

JavaScript Ascii animation with while loops and console.log

playing with trigonometry sin in pygame