Linked list & radix sort question, please help!
Hey everyone,
I'm in my first year in college and I've been cracking my brain for about a week over this program, but no luck. Let me just describe a couple of basic problems i have, and if anybody can provide any help, it'd be much appriciated!
First of all, I want to add items to the end of a linked list. I know how to do it using a function that gets a pointer to the start of the list, but the function i need to write is supposed to get a pointer to the end of the list. That is very confusing to me. I don't even know what to send the function....
The main purpse of the program i'm writing is to sort a bunch of numbers (input includes the exact number) using radix sort. The trick is though, that i need to do it using the binary repesentation of the numbers, and use only 1 linked list. I have yet to come up with an algoritm to do this, I really need some help! I've tried asking my classmates but they don't know either.
Thanks in advance,
Lior
Re: Linked list & radix sort question, please help!
Thanks, I understand what you're saying but I need to do something a little different. In my main program, I will need to add a lot of records to the end of the list. To make that process more useful, I thought I'd keep track of the "tail" of the list at all times and send the tail pointer to the add function. That way I won't have to loop around and find where to add the record, cause i'll have the pointer tail.
In theory, I pretty much understand what i have to do, but i get lost trying to use that tail pointer...