c and c++ insertion sort