Class NQueenSolutionChecker


  • public class NQueenSolutionChecker
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean attack​(java.util.List<java.lang.Integer> positions, int i, int j)
      Checks if a cell is attacked by the queens on the board
      static boolean isSolution​(java.util.List<java.lang.Integer> solution)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isSolution

        public static boolean isSolution​(java.util.List<java.lang.Integer> solution)
      • attack

        public static boolean attack​(java.util.List<java.lang.Integer> positions,
                                     int i,
                                     int j)
        Checks if a cell is attacked by the queens on the board
        Parameters:
        i - The row of the cell to be checked.
        j - The collumn of the cell to be checked.
        Returns:
        true if the cell is attacked, false otherwise.