Java Array Invert invertList(int[] pos)

Here you can find the source of invertList(int[] pos)

Description

invert List

License

Apache License

Declaration

public static int[] invertList(int[] pos) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int[] invertList(int[] pos) {
        int[] result = new int[pos.length];
        for (int i = 0; i < pos.length; i++) {
            result[pos[i]] = i;/*from  ww  w  .  j a v a  2 s . c o  m*/
        }
        return result;
    }
}

Related

  1. invertedLength3(float[] a)
  2. inverter(double[] vector)
  3. invertHostNameFast(byte[] tokens, int offset, int length, byte[] destinationBuffer)
  4. invertI(long[] v)
  5. invertirTabla2(int[] tabla)
  6. invertMap(int[] map)
  7. invertMapping(int[] mapping)
  8. invertOrder(double[] values)
  9. invertOrientation(int[] face)