Just want to rearrange the data in array so that similar items are not next to each. The data should not be removed from the array, if it can\'t be rearranged it can be put
Assuming A Array Containing Digits Between 0 To 9:
Similar To Bucket Sort In A Way
int B[10];//buckets
diff=0;//how many different digits appeared
for(i=0;i=0)//now to place back to array makes an interleaving
{
for(digit=0;digit<10;digit++)
{
if(B[digit]<>0)
{
A[B[digit]+diff]=digit;
B[digit]--;
}
}
diff--;
}