Java code to generate all possible subsequences . Time Complexity O ( n * 2 ^ n )
import java . math . BigInteger ; class Test { static int arr [ ] = new int [ ] { 1 , 2 , 3 , 4 } ; static void printSubsequences ( int n ) {