Skip to content
Commit 274a46c9 authored by Adhemerval Zanella's avatar Adhemerval Zanella
Browse files

stdlib: Implement introsort for qsort (BZ 19305)



This patch makes the quicksort implementation to acts as introsort, to
avoid worse-case performance (and thus making it O(nlog n)).  It switch
to heapsort when the depth level reaches 2*log2(total elements).  The
heapsort is a textbook implementation.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.
Reviewed-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
parent d097f3c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment