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

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

Description

swap

License

Apache License

Declaration

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

Method Source Code

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

public class Main {
    public static void swap(int i, int j, Integer[] unsorted) {
        Integer t = unsorted[i];/* w w  w. j  av  a2s. co  m*/
        unsorted[i] = unsorted[j];
        unsorted[j] = t;
    }

    public static void swap(int i, int j, int[] unsorted) {
        Integer t = unsorted[i];
        unsorted[i] = unsorted[j];
        unsorted[j] = t;
    }
}

Related

  1. swap(final T[] arr, final int i, final int j)
  2. swap(final T[] arr, final int i, final int j)
  3. swap(int arr[], int i, int j)
  4. swap(int array[], int first, int last)
  5. swap(int arrs[], int i, int j)
  6. swap(int i, int j, String[] index)
  7. swap(int keys[], int values[], int a, int b)
  8. swap(int[] a, int first, int second)
  9. swap(int[] a, int i, int j)