Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

N-Queen Problem

This is the basic problem of Back tracking. The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other.

Input Format

Only line will take the value of N.

Output Format

Output is matrix of 1 and 0.

Sample Input

5

Sample Output

1 represents queen is there and 0 represents vacant space on the board: 
 1  0  0  0  0 
 0  0  0  1  0 
 0  1  0  0  0 
 0  0  0  0  1 
 0  0  1  0  0

Implemented in: