hi i have write LSD radix sort but it does not work can anybody help me?
here is code

public class LSD{

public static int R=1<<8;
public static int bytesword=4;
public static void radixLSD(int a[],int l,int r){
  int  aux[]=new int[a.length];

 for (int d=bytesword-1;d>=0;d--){
   int i, j;
 int count[]=new int[R];
   for ( j=0;j<R;j++) count[j]=0;
   for (i=l;i<r;i++)
  count[digit(a[i],d)+1]++;
   for (j=1;j<R;j++)
  count[j]+=count[j-1];
   for (i=l;i<r;i++)
   aux[count[digit(a[i],d)]++]=a[i];
  for (i=l;i<r;i++)
   a[i]=aux[i-1];
}

}

public static void main(String[]args){
int a[]=new int[]{3,6,5,7,4,8,9};
radixLSD(a,0,a.length);

 for (int i=0;i<a.length;i++){
  System.out.println(a[i]);
}

}

 public static int digit(int n,int d){
  return (n>>d)&1;

}
}

sorry, LSD is so 1960s :)

"does not work" doesn't tell us anything. Be more specific, a lot more specific.
And please correct your code tags, you tried to use them but I think you forgot the close tag.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.