Function swap

  • Exchange two values.

    Type Parameters

    • T

    Parameters

    • x: T[]

      an array

    • i: number

      an index

    • j: number

      another index

    Returns T[]

    x' | x' = x; x'[i] = x[j]; x'[j] = x[i]

Generated using TypeDoc