Java List Sort sort(String prefix, int[] a, List list)

Here you can find the source of sort(String prefix, int[] a, List list)

Description

sort

License

Apache License

Declaration

private static List<String> sort(String prefix, int[] a, List<String> list) 

Method Source Code

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

import java.util.List;

public class Main {
    private static List<String> sort(String prefix, int[] a, List<String> list) {
        if (a.length == 1) {
            list.add(prefix + a[0]);/* w  w  w. j ava2 s . c o  m*/
        }
        for (int i = 0; i < a.length; i++) {
            sort(prefix + a[i], copy(a, i), list);
        }
        return list;
    }

    private static int[] copy(int[] a, int index) {
        int[] b = new int[a.length - 1];
        System.arraycopy(a, 0, b, 0, index);
        System.arraycopy(a, index + 1, b, index, a.length - index - 1);
        return b;
    }
}

Related

  1. sort(List list, Comparator comparator)
  2. sort(List list, Comparator comparator)
  3. sort(List list, Comparator comparator, String sort, boolean sortOrder)
  4. sort(List objs, Comparator cp)
  5. sort(Set list, Comparator comparator)
  6. sortAndFormat(List stringList)
  7. sortAndReturn(final List list)
  8. sortBy(List> list, final Map orderBy)
  9. sortByByteDeux(List symbolAL, int delimiter)