Java List Permutate permute(T[] arr, List p)

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

Description

permute

License

Apache License

Declaration

public static <T> T[] permute(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[] permute(T[] arr, List<Integer> p) {
        //return arr;
        T[] arr_new = arr.clone();
        for (int i = 0; i < arr.length; i++) {
            arr_new[p.get(i)] = arr[i];
        }//from  w w w  .j  ava 2s  .c o  m
        return arr_new;
    }
}

Related

  1. permutations(Map> parameterValues)
  2. permute(List s1, List s2)
  3. permute(List arr)
  4. permute(List list1)
  5. permute(List list, int index, List> result)
  6. permutedGroups(List> elementLists)
  7. permuteList(List list, int[] permutations)
  8. permuteList(List in, int seed)
  9. permuteList(List list, Integer[] permutation)