FastLED 3.10.10
Loading...
Searching...
No Matches

◆ heap_sort()

template<typename Iterator, typename Compare>
void fl::detail::heap_sort ( Iterator first,
Iterator last,
Compare comp )

Definition at line 413 of file algorithm.h.

413 {
414 heapify(first, last, comp);
415
416 Iterator end = last - 1;
417 while (end > first) {
418 swap(*end, *first);
419 detail::sift_down(first, first, end - 1, comp);
420 --end;
421 }
422}
constexpr T * end(T(&array)[N]) FL_NO_EXCEPT
void heapify(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:400
void sift_down(Iterator first, Iterator start, Iterator end, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:374
void swap(array< T, N > &lhs, array< T, N > &rhs) FL_NO_EXCEPT
Definition array.h:209

References fl::adl_barrier::end(), fl::FL_NO_EXCEPT, heapify(), sift_down(), and fl::swap().

Referenced by quicksort_impl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: