Class ChessHorse
java.lang.Object
topics.greedy.ChessHorse
GREEDY ALGORITHM PROBLEM: THE HORSE JUMPING PROBLEM (Knight's tour)
It has not an optimal solution in some cases
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhorse(int[] pos) Checks whether the horse can complete the boardvoid
-
Constructor Details
-
ChessHorse
public ChessHorse(int n) Constructor for ChessHorse objects- Parameters:
n- Size of the board
-
-
Method Details
-
horse
public boolean horse(int[] pos) Checks whether the horse can complete the board- Parameters:
pos- Initial position of the horse- Returns:
- Whether the horse complete the board
-
writeSolution
public void writeSolution()
-