Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want a code to sort list of names using the Radix Sort function, which should have the following:
• Use the cursor implementation to store names in buckets.

I understand how radix sort works and its algorithm but i've tried several times without getting any results .i need a help in radix sort for strings using cursor implementation of linked lists

What I have tried:

i do have the cursor implementation and its functions and a itried the following:

C++
void Radix_Sort(char names[5][5], int max)
{
    int i, j;

    //1.initialize 27 bucket(array of cursor)
    for (i = 0; i < 27; i++)
    {
        buckets[i] = CursorAlloc();
    }
    for (j = 0; j < 5; j++)
    {
        for (i = 0; i < 5; i++)
        {
            switch (names[j][i])
            {
                case 'a':
                    // initialize first list in the first cursor
                    // for small letters  and point head to 0
                    // List list1 = initializeList();
                    buckets[0].Element = names[j];
                    PrintFreeList();
                    break;
            }
        }
    }
}
Posted
Updated 28-Apr-18 6:33am
v3

Quote:
I want a code to sort list of names using ...


Not going to happen: we do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
Quote:
I want a code to sort list of names using the Radix Sort function

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

Quote:
I understand how radix sort works and its algorithm but i've tried several times without getting any results .i need a help in radix sort for strings using cursor implementation of linked lists

As far as I see, the code is not related to Radix Sort. May be you should describe the problem you have.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900