Java Array Swap swap(int[] arr, int i, int j)

Here you can find the source of swap(int[] arr, int i, int j)

Description

swap

License

Apache License

Declaration

public static void swap(int[] arr, int i, int j) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void swap(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];//from w  w w.j a v  a2s. c  o m
        arr[j] = temp;
    }
}

Related

  1. swap(int[] a, int first, int second)
  2. swap(int[] a, int i, int j)
  3. swap(int[] arr, int a, int b)
  4. swap(int[] arr, int a, int b)
  5. swap(int[] arr, int a, int b, int c, int d, int key)
  6. swap(int[] array)
  7. swap(int[] array, int i, int j)
  8. swap(int[] array, int idx1, int idx2)
  9. swap(int[] array, int index0, int index1)