Sorting algorithms/Insertion sort: Difference between revisions

m
→‎{{header|C++}}: +note on complexity
m (→‎{{header|C++}}: correct lang tag)
m (→‎{{header|C++}}: +note on complexity)
Line 213:
 
=={{header|C++}}==
Faster than the basic algorithm because std::lower_bound() finds the insertion position in logarithmic time. Insertion itself, performed with std::rotate(), is still linear.
 
<lang cpp>#include <algorithm>
#include <vector>
Anonymous user