Class ChessQueensOne

java.lang.Object
topics.backtracking.ChessQueensOne

public class ChessQueensOne extends Object
BACKTRACKING PROBLEM: THE PROBLEM OF THE N QUEENS This program calculates one way of placing n queens on a chessboard of side n
Author:
vicegd
  • Constructor Details

    • ChessQueensOne

      public ChessQueensOne(int n)
      Constructor for ChessQueensOne objects
      Parameters:
      n - Size of the board
  • Method Details

    • backtracking

      public void backtracking(int j)
      Performs the backtracking process
      Parameters:
      j - Level in the tree of states starting at 0
    • isSolution

      public boolean isSolution()
      Returns whether there is a solution
      Returns:
      True is there is a solution. False otherwise