void insertSort(T arr, int n)
{
cout << "yidiaoyong" << endl;
for (int i = 1; i < n; i++)
for (int j = i; j > 0; j--)
if (arr[j] < arr[j-1])
swap(arr[j], arr[j-1]);
else
break;
}
原文:http://www.cnblogs.com/bohat/p/7932222.html