المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Converting int type radix sort to string type radix sort



C# Programming
09-03-2009, 04:50 PM
can someone help me convert this code from int base to string base radix sort? I don't know what are the things I must change for it to sort a string type data. I got this from the net, in wiki particularly..

here is the code:


public void RadixSort(int[] a)
{
// our helper array
int[] t=new int[a.Length];

// number of bits our group will be long
int r=4; // try to set this also to 2, 8 or 16 to see if it is
//quicker or not

// number of bits of a C# int
int b=32;

// counting and prefix arrays
// (note dimensions 2^r which is the number of all possible values of a
//r-bit number)
int[] count=new int[1