|
By Yin-So Chen Unlike most other sorting algorithms, Radix Sort does not involve comparison between the items being sorted. Instead, Radix Sort shuffles the items into small bins, then recollect the bins and repeat the process until the array is sorted. The magic of Radix Sort lies in finding the key to shuffle the items. For integer data, the key is each individual digits. In a group of data, there can be up to ten bins for each digit (0 - 9). Thus we isolate each individual digit of each data, and place into the corresponding bin. When we start, we start with the least significant digit and work our way up to the most significant digit. Below is the pseudo-code of Radix Sort.
Discuss this article in the forums
See Also: © 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|