4#ifndef TETL_ALGORITHM_BUBBLE_SORT_HPP
5#define TETL_ALGORITHM_BUBBLE_SORT_HPP
7#include <etl/_algorithm/iter_swap.hpp>
8#include <etl/_functional/less.hpp>
21template <
typename RandomIt,
typename Compare>
22constexpr auto bubble_sort(RandomIt first, RandomIt last, Compare comp) ->
void
24 for (
auto i = first; i != last; ++i) {
25 for (
auto j = first; j < i; ++j) {
39template <
typename RandomIt>
40constexpr auto bubble_sort(RandomIt first, RandomIt last) ->
void
constexpr auto bubble_sort(RandomIt first, RandomIt last, Compare comp) -> void
Sorts the elements in the range [first, last) in non-descending order. The order of equal elements is...
Definition bubble_sort.hpp:22
constexpr auto bubble_sort(RandomIt first, RandomIt last) -> void
Sorts the elements in the range [first, last) in non-descending order. The order of equal elements is...
Definition bubble_sort.hpp:40
Definition adjacent_find.hpp:9
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15