Skip to content

Instantly share code, notes, and snippets.

@niklio
Last active March 19, 2017 00:12
Show Gist options
  • Save niklio/5d689d20dc137b047d130c2e3f72c22b to your computer and use it in GitHub Desktop.
Save niklio/5d689d20dc137b047d130c2e3f72c22b to your computer and use it in GitHub Desktop.
template <typename T>
void SortAlg<T>::insertionSort(typename vector<T>::iterator s,
typename vector<T>::iterator e) {
typename vector<T>::iterator i, j;
for (i = s + 1; i < e; i++) for (j = i; j > s && *(j - 1) > *j; j--) iter_swap(j, j - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment