mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
selection_sort
This commit is contained in:
parent
bb9f27bd8d
commit
c75e7afe68
@ -3350,22 +3350,6 @@ namespace etl
|
||||
etl::sort_heap(first, last, compare);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Sorts the elements using heap sort.
|
||||
/// Uses user defined comparison.
|
||||
///\ingroup algorithm
|
||||
//***************************************************************************
|
||||
template <typename TIterator, typename TCompare >
|
||||
void heap_sort(TIterator first, TIterator last, TCompare compare)
|
||||
{
|
||||
if (!etl::is_heap(first, last, compare))
|
||||
{
|
||||
etl::make_heap(first, last, compare);
|
||||
}
|
||||
|
||||
etl::sort_heap(first, last, compare);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Sorts the elements using heap sort.
|
||||
///\ingroup algorithm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user