Driver function .
public static void main ( String [ ] args ) { int n = 3 ; Vector < Integer > code = grayCodes ( n ) ; for ( int i = 0 ; i < code . size ( ) ; i ++ ) System . out . print ( code . get ( i ) + "NEW_LINE"); } }