Package nqueens.lab
Class FirstAvailableRowSearchAlgorithm
java.lang.Object
nqueens.lab.FirstAvailableRowSearchAlgorithm
- All Implemented Interfaces:
RowSearchAlgorithm
@Immutable public final class FirstAvailableRowSearchAlgorithm extends java.lang.Object implements RowSearchAlgorithm
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors Constructor Description FirstAvailableRowSearchAlgorithm() -
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.Integer>selectedNextUnplacedRow(ImmutableQueenLocations queenLocations)Given a specified queenLocations, return an available row.
-
Constructor Details
-
FirstAvailableRowSearchAlgorithm
public FirstAvailableRowSearchAlgorithm()
-
-
Method Details
-
selectedNextUnplacedRow
public java.util.Optional<java.lang.Integer> selectedNextUnplacedRow(ImmutableQueenLocations queenLocations)Description copied from interface:RowSearchAlgorithmGiven a specified queenLocations, return an available row. If no row is available, Optional.empty() is returned.- Specified by:
selectedNextUnplacedRowin interfaceRowSearchAlgorithm- Parameters:
queenLocations- the specified board- Returns:
- an available row, if one exists
-