Template Function sequant::bubble_sort

Function Documentation

template<typename ForwardIter, typename Sentinel, typename Compare = std::less<>>
void sequant::bubble_sort(ForwardIter begin, Sentinel end, Compare comp = {})

bubble sort that uses swap exclusively

Note

does not assume Compare to be strict, unlike std::sort

Template Parameters:
  • ForwardIter – a forward iterator

  • Sentinel – a sentinel type

  • Compare – a less-than relationship that specifies a weak order