Recursively put brackets around subexpression from i to bracket [ i ] [ j ] . Note that " * ( ( bracket + i * n ) + j ) " is similar to bracket [ i ] [ j ]
printParenthesis ( i , * ( ( bracket + i * n ) + j ) , n , bracket , name ) ;