This is Binary Insertion sort, it has algorithms for both biggest to smallest and smallest to biggest inside.