#include <iostream>
using namespace std;
/* insert sort*/
template <typename T>
void insertSort(T array[], T len)
{
for (int i = 1, j; i < len; ++i)
{
T data = array[i];
for (j = i; j > 0 && array[j - 1] > data; --j)
{
array[j] = array[j - 1];
}
array[j] = data;
}
}
int main()
{
int array[10] = {2, 3, 5, 1, 0, 40, 8, 22, 13, 100};
insertSort<int>(array, 10);
for (int i = 0; i < 10; ++i)
{
cout << array[i] << ' ';
}
cout << endl;
return 0;
}