A Optimized function to check if a queen can be placed on board [ row ] [ col ]
static boolean isSafe ( int row , int col , int slashCode [ ] [ ] , int backslashCode [ ] [ ] , boolean rowLookup [ ] , boolean slashCodeLookup [ ] , boolean backslashCodeLookup [ ] ) { if ( slashCodeLookup [ slashCode [ row ] [ col ] ] backslashCodeLookup [ backslashCode [ row ] [ col ] ] rowLookup [ row ] ) return false ; return true ; }