Skip to content

This is a bit representation of my solution to the nQueens problem.

Notifications You must be signed in to change notification settings

bigthyme/nQueens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

nQueens

Here's a solution to the nQueen's algorithm using bit shifting and bitwise operators.

The algorithm operates on the premise that a chessboard's current state can be represented by 8 bit binary numbers.

[i.e. given n = 4; n empty columns ==== 0000]

Academic History

The nQueens problem has been tackled by many academics who try to improve the time complexity of the algorithm that finds ways to place any number of queens (represented by n) on an n x n board size.

To see a more thorough explanation of the problem and bit solution, check out: nQueens research

Specifications

This nQueens solution is implemented in Javascript, to read more about Javascript bitwise operators -- refer to Mozilla's documentation on bitwise operators.

Installation

git clone https://github.com/bigthyme/nQueens.git
cd nQueens

After doing this, you can just copy and paste the contents of nQueens.js and paste it into your browser console (or node console) to run the code.

License

MIT License

About

This is a bit representation of my solution to the nQueens problem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published