sorting /the two-parameter version calls the three-parameter versionusing ++ decltype *template void insertionsortconst iterator beginconst iterator end insertionsortbeginendless)figure two-parameter sort invokes three-parameter sort via ++ decltype template void insertionsortconst iterator beginconst iterator endcomparator lessthan ifbegin =end returniterator jforiterator begin+ !end++ auto tmp std::move* )forj pj !begin &lessthantmp* - )-- * std::move*( - )* std::movetmp )figure three-parameter sort using iterators straightforward use of iterators and the function object the original code is arguably much simpler to readwhich is why we use our simpler interface rather than the stl interface when coding our sorting algorithms analysis of insertion sort because of the nested loopseach of which can take iterationsinsertion sort is ( furthermorethis bound is tightbecause input in reverse order can achieve this bound precise calculation shows that the number of tests in the inner loop in figure is at most for each value of summing over all gives total of = (