stdlib: Handle various corner cases in the fallback heapsort for qsort
The previous implementation did not consistently apply the rule that the child nodes of node K are at 2 * K + 1 and 2 * K + 2, or that the parent node is at (K - 1) / 2. Add an internal test that targets the heapsort implementation directly. Reported-by:Stepan Golosunov <stepan@golosunov.pp.ru> Reviewed-by:
Adhemerval Zanella <adhemerval.zanella@linaro.org>
Loading
Please register or sign in to comment