Java List Reverse reversePermutation(T[] arr, List p)

Here you can find the source of reversePermutation(T[] arr, List p)

Description

reverse Permutation

License

Apache License

Declaration

public static <T> T[] reversePermutation(T[] arr, List<Integer> p) 

Method Source Code

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

import java.util.List;

public class Main {
    public static <T> T[] reversePermutation(T[] arr, List<Integer> p) {
        T[] arr_new = arr.clone();
        for (int i = 0; i < arr.length; i++) {
            arr_new[i] = arr[p.get(i)];
        }/*  w ww .  jav a  2  s .  c  om*/
        return arr_new;
    }
}

Related

  1. reverseList2(List list)
  2. reverseListShallowCopy(List list)
  3. reverseOrder(List list)
  4. reversePath(List pathParts)
  5. reversePermutation(final List permutation)
  6. reverseSort(final List lines)
  7. reverseUseList(int[] values)
  8. reverseVector(List vector)
  9. sortListBySublistSizeThenHead(List> list, boolean reverseOrder)