if the node has not been visited set it and its children marked
for ( int i = 0 ; i < connectchars [ parent ] . size ( ) ; i ++ ) { if ( ! ans [ connectchars [ parent ] [ i ] ] ) dfs ( connectchars [ parent ] [ i ] , ans , connectchars ) ; } } void printBinaryPalindrome ( int n , int k ) { int arr [ n ] , ans [ n ] = { 0 } ;