Here you can find the source of swap(int arrs[], int i, int j)
Parameter | Description |
---|---|
arrs | The array |
i | the index of the first position to interchange |
j | the index of the second position to interchange |
public static void swap(int arrs[], int i, int j)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww .ja v a 2 s . c o m*/ * Swap method, It is used to intechange values into an array. * * @param arrs The array * @param i the index of the first position to interchange * @param j the index of the second position to interchange */ public static void swap(int arrs[], int i, int j) { int temp = arrs[i]; arrs[i] = arrs[j]; arrs[j] = temp; } }