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

  Source Code
AI Tips and Tricks

  Code Journal
Site Updates

An Affiliate of

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

This source file is an implementation of the Selection Sort algorithm. The sort is implemented with templates.

For the templated class, the elements must have the operators >, =, and < defined.

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

SelectionSort<TYPE>(Array, Num);

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

Download the Source: selection.h

All content is written and published by the people at or affiliated with AI Horizon <>.
Send any comments and suggestions to [email protected].

Please report any errors to [email protected].