FastLED 3.9.15
Loading...
Searching...
No Matches

◆ quicksort_impl()

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

Definition at line 351 of file algorithm.h.

351 {
352 if (last - first <= 16) { // Use insertion sort for small arrays
353 insertion_sort(first, last, comp);
354 return;
355 }
356
357 Iterator pivot = partition(first, last, comp);
358 quicksort_impl(first, pivot, comp);
359 quicksort_impl(pivot + 1, last, comp);
360}
Iterator partition(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:278
void insertion_sort(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:238
void quicksort_impl(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:351

References insertion_sort(), partition(), and quicksort_impl().

Referenced by quicksort_impl(), and fl::sort().

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