Here you can find the source of swapArray(int[] v, int i, int j)
Parameter | Description |
---|---|
v | list |
i | index first element |
j | index second element |
public static void swapArray(int[] v, int i, int j)
//package com.java2s; //License from project: LGPL public class Main { /**//from ww w . j a v a 2s . co m * Swap elements in list * * @param v list * @param i index first element * @param j index second element */ public static void swapArray(int[] v, int i, int j) { int t = v[i]; v[i] = v[j]; v[j] = t; } }