Here you can find the source of swap(int[] a, int first, int second)
public static void swap(int[] a, int first, int second)
//package com.java2s; //License from project: Open Source License public class Main { public static void swap(int[] a, int first, int second) { if (first == second) { return; }/* w w w . j a v a 2 s . co m*/ int temp = a[first]; a[first] = a[second]; a[second] = temp; } }