phaser - v4.0.0-rc.4
    Preparing search index...
    • A Floyd-Rivest quick selection algorithm.

      Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; The k-th element will have the (k - left + 1)th smallest value in [left, right].

      The array is modified in-place.

      Based on code by Vladimir Agafonkin

      Parameters

      • arr: any[]

        The array to sort.

      • k: number

        The k-th element index.

      • Optionalleft: number

        The index of the left part of the range. Default 0.

      • Optionalright: number

        The index of the right part of the range.

      • Optionalcompare: Function

        An optional comparison function. Is passed two elements and should return 0, 1 or -1.

      Returns void