isort1 / isort2

void isort1(double* first, double* last)

Sorts the elements of [first, last) into ascending numerical order using the insertion sort.

void isort2(double* first, double* last, double* first2)

Sorts the elements of [first, last) into ascending numerical order using the insertion sort while making the same rearrangement of the elements of [first2, first2 + (last1 - first1) ).

Parameters:
firstBeginning iterator for element container.
lastEnding iterator for element container
first2Beginning iterator for second element container.

Returns:
The values in [first, last) are sorted inplace and the first2 elements are changed accordingly.

Usage:

double x[] = {2.0, 3.0, 2.5, 1.4, 5.3};
double y[] = {1.0, 2.0, 3.0, 2.5, 3.6};
isort2(x, x + 5, y);

Header:
#include "sort.h"