C++1111111111111111111111111111111222222222222222222222222222222
分类: C/C++
2009-11-24 14:48:28
fera2009-12-04 17:49:30
Selection Sort: int FindPos(int* aArray, int aCurPos, int aLen) { int pos = aCurPos; int key = aArray[aCurPos]; // Start from current position which is the begin of unsorted array. for (int i = aCurPos; i < aLen; ++i) { if (aArray[i] < key) { // Update the position found and the smallest element. pos = i; key = aArray[i]; } } return pos; } void SelectionSort(int* aArray, int aLen) { //