Java Array Swap swap(double[] array, int i, int j)

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

Description

swap

License

Open Source License

Declaration

private static void swap(double[] array, int i, int j) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    private static void swap(List list, int i, int j) {
        Object tmp = list.get(i);
        list.set(i, list.get(j));/*  w w w. j av a 2  s  .  c o  m*/
        list.set(j, tmp);
    }

    private static void swap(double[] array, int i, int j) {
        double tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
    }
}

Related

  1. swap(byte[] data, int p, int q)
  2. swap(byte[] rv, int offsetA, int offsetB)
  3. swap(Comparable[] a, int oldIndex, int newIndex)
  4. swap(double x[], Object[] corr, int a, int b)
  5. swap(double[] a, int i, int j)
  6. swap(double[] data, int i, int j)
  7. swap(final byte[] array, int firstIndex, int secondIndex)
  8. swap(final byte[] src)
  9. swap(final float[] pVertices, final int pVertexStride, final int pVertexIndexA, final int pVertexIndexB)