Here you can find the source of swap(int keys[], int values[], int a, int b)
private static void swap(int keys[], int values[], int a, int b)
//package com.java2s; /**/*w ww. j a v a2s . c o m*/ * **************************************************************************** * Copyright (c) 2008 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * SAP AG - initial API and implementation * ***************************************************************************** */ public class Main { private static void swap(int keys[], int values[], int a, int b) { // swap the keys int tmp = keys[a]; keys[a] = keys[b]; keys[b] = tmp; // swap the values tmp = values[a]; values[a] = values[b]; values[b] = tmp; } private static void swap(long keys[], int values[], int a, int b) { // swap the keys long tmpKey = keys[a]; keys[a] = keys[b]; keys[b] = tmpKey; // swap the values int tmpValue = values[a]; values[a] = values[b]; values[b] = tmpValue; } }