public class C2_1 { /** * Prints all subsets of the array. * * Given array length of N, the method takes O(2^N) time. * * @param a the array * @throws IllegalArgumentException if array missing */ public static void printSubsets(int[] a){ if( a == null ){ throw new IllegalArgumentException(); } boolean[] c = new boolean[a.length]; printSubsets(a, c, 0); } private static void printSubsets(int[] a, boolean[] c, int i){ if( i == a.length ){ boolean printed = false; System.out.print("["); for(int j=0 ; j