Click here to Skip to main content
13,668,886 members
Rate this:
 
Please Sign up or sign in to 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:

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 7-Apr-18 9:38am
Updated 28-Apr-18 6:33am
v3
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180820.1 | Last Updated 28 Apr 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100