@Kumar: Although it would be natural to use base 10 when you are using
paper and pencil, you don't have to use base 10 to do your radix sort
on a computer, where the numbers are stored internally in binary
format. So use a base that is a power of 2 so that you can use a shift
and a logical product to separate the "digits."

Dave

On Aug 6, 12:24 am, kumar raja <[email protected]> wrote:
> suppose i have 6 numbers  379,635,274,743,980,835
>
> i read that radix sort runs in O(d(n+k)) time. where d-number of digits
> ,n=6,k=each digit range.
>
> But after the elements are sorted on LSB ,to find next digit we need to
> perform / and % operation
>
>   379 /10 = 37  and 37 %10= 7
> so  it is taking O(d) time to calculate radix/digit in each pass
>
> Can anybody tell me how do get the kth digit in number using some bitwise
> operations in constant time.
>
> --
> Regards
> Kumar Raja
> M.Tech(SIT)
> IIT Kharagpur,
> [email protected]
> 7797137043.
> 09491690115.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to