<p>The other day I decided to write an implementation of <a href="http://en.wikipedia.org/wiki/Radix_sort" rel="nofollow noreferrer">radix sort</a> in Java. Radix sort is supposed to be O(k*N) but mine ended up being O(k^2*N) because of the process of breaking down each digit to one number. I broke down each digit by modding (%) the preceding digits out and dividing by ten to eliminate the succeeding digits. I asked my professor if there would be a more efficient way of doing this and he said to use bit operators. Now for my questions: Which method would be the fastest at breaking down each number in Java, 1) Method stated above. 2) Convert number to String and use substrings. 3) Use bit operations. </p>

<p>If 3) then how would that work?</p>

Radix_sort_(Java)
The line of code that does this;
```
```
int key = (a[p] & mask) >> rshift;
```
```
is the bit manipulation part.
```
&
```
is the operator to do a bitwise AND and
```
>>
```
is a right-shift.