Program for Implementation of N-Queen problem in Java

The n queens puzzle is the problem of placing eight chess queens on an n×n chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diagonal.

import java.io.*;
import java.util.*;
import java.lang.*;
class Queen
{
int x[]=new int[20];
void NQueen(int k,int n)
{
int i;
for(i=0;i

Leave a Reply

Your email address will not be published. Required fields are marked *