Recursive function to generate all binary strings formed by replacing each wildcard character by 0 or 1
public static void print ( char [ ] str , int index ) { if ( index == str . Length ) { Console . WriteLine ( str ) ; return ; } if ( str [ index ] == ' ? ' ) {