NQueenProblem.java
/* A recursive function that solves the N Queen problem */
A recursive function that solves the N Queen problem
A recursive function that solves the N Queen problem
boolean NQueenProblemSolve(int chessBoard[][], int col) {
	/* If all queens are placed on the board then return the output is true */
	if (col >= N)
	return true;
	/* Places the queen in all rows in the designated column */
	for (int i = 0; i < N; i++) {
	if (isSecured(chessBoard, i, col)) {
	/* Places the queen in chessBoard[i][col] */
	chessBoard[i][col] = 1;
	/* recurse to place rest of the queens */
	if (NQueenProblemSolve(chessBoard, col + 1) == true)
	return true;
	/* If placing queen in chessBoard[i][col]
	doesn't lead to a solution then
	remove queen from chessBoard[i][col] */
	chessBoard[i][col] = 0; 
	}
	}
	/* Returns false if the queen cannot be placed in any of the row in the designated column */
	return false;
	}
boolean NQueenProblemSolve ( int chessBoard [ ] [ ] , int col ) { /* If all queens are placed on the board then return the output is true */ if ( col >= N ) return true ; /* Places the queen in all rows in the designated column */ for ( int i = 0 ; i < N ; i ++ ) { if ( isSecured ( chessBoard , i , col ) ) { /* Places the queen in chessBoard[i][col] */ chessBoard [ i ] [ col ] = 1 ; /* recurse to place rest of the queens */ if ( NQueenProblemSolve ( chessBoard , col + 1 ) == true ) return true ; /* If placing queen in chessBoard[i][col]
	doesn't lead to a solution then
	remove queen from chessBoard[i][col] */ chessBoard [ i ] [ col ] = 0 ; } } /* Returns false if the queen cannot be placed in any of the row in the designated column */ return false ; }
A recursive function that solves the N Queen problem
A recursive function that solves the N Queen problem
//] Checks if the queen can be placed on chessBoard[i][col] */
 // If there is no solution just BACKTRACK
