AI Horizon: Intelligence and Reason in Computers
Introduction Home Essays Resources Contact Info
Essays
  Basic CS
General AI
Chess AI
Go AI

Resources
  Source Code
AI Tips and Tricks
Books
Links

Other
  Code Journal
Site Updates

An Affiliate of Cprogramming.com
 

Radix Sort Source Code
(Up to Resources : Source Code Repository : Sorts)

This source file is an implementation of the Radix Sort algorithm. The sort is implemented with templates. For the templated class, the elements must have the operators >, =, and < defined.

This sort also uses queues, so the queue.h file that AI Horizon supplies should be used with this sort.

The sort itself is implemented as a class constructor. Basically, the function call is in the following format:

RadixSort(Array, Num);

Array is the actual array to be sorted, and Num is the number of elements that are to be sorted. The elements must be integers. The array is sorted in place, so there is no actual return value for the function.

Since this sort uses queues, a limit is imposed upon the maximum size of the array to be sorted. Each digit queue can hold up to 500 numbers.

Download the Source: radix.h

All content is written and published by the people at or affiliated with AI Horizon <http://www.aihorizon.com/>.
Send any comments and suggestions to comments@aihorizon.com.

Please report any errors to webmaster@aihorizon.com.