protected static function insertionSort(array &$arr, int $lo, int $hi, callable $comp): void
    {
        for ($i = $lo; $i <= $hi; $i++) {
            for ($j = $i; $j > $lo && static::lt($arr[$j], $arr[$j - 1], $comp); $j--) {
                static::exch($arr, $j, $j - 1);
            }
        }
    }