Selection Sort
Array
   Step-by-Step Animation   Animation Speed 
Elaboration:
?
Selection Sort: This algorithm sorts (poorly) in O(n2) where n is the size of the input array/vector.
The algorithm is fully explained, with more references, here.
The following code is a snippet of what is found at the link, but it's the most relevent piece:
Given:
Array v of n values to be sorted
Method:
for(i = 0; i < n - 1; i++) {
  min_index = i;
  for(j = i + 1; j < n; j++){
    if(v[j] < min_index){
      min_index = j;
    }
  }
  tmp = v[i];
  v[i] = v[min_index];
  v[min_index] = tmp;
}
          
选择排序定义:选择排序首先从第一次从待排序的数据元素中选出最小(或最大)的一个元素,存放在序列的起始位置,然后再从剩余的未排序元素中寻找到最小(大)元素,然后放到已排序的序列的末尾。以此类推,直到全部待排序的数据元素的个数为零。要注意的是,该算法是不稳定的排序方法。
Method:
for(i = 0; i < n - 1; i++) {
  min_index = i;
  for(j = i + 1; j < n; j++){
    if(v[j] < min_index){
      min_index = j;
    }
  }
  tmp = v[i];
  v[i] = v[min_index];
  v[min_index] = tmp;
}