Packages

object Swap

The Swap class provides a method to swap elements in an Array or ArrayBuffer. Note, ArrayBuffer is resizable (similar to Java's ArrayList).

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Swap
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def swap[T](a: ArrayBuffer[T], i: Int, j: Int): Unit

    Swap two elements in a resizable array.

    Swap two elements in a resizable array.

    i

    first element to swap

    j

    second element to swap

  2. def swap[T](a: Array[T], i: Int, j: Int): Unit

    Swap two elements in a regular array.

    Swap two elements in a regular array.

    i

    first element to swap

    j

    second element to swap