private void print(int[] input, int[] output, int len, int current, boolean print) {

        if (print) {
            for (int i = 0; i < len; i++) {
                System.out.print(output[i] + " ");
            }
            System.out.println();
        }
        if (current == input.length) {
            return;
        }


        output[len] = input[current];
        print(input, output, len + 1, current + 1, true);
        print(input, output, len, current + 1, false);
    }
Date 02/25/2016
@author Tushar Roy

Print all subsequence of a given array.

Time complexity is exponential
Space complexity is O(n)
src/com/interview/recursion/PrintAllSubsequence.java