diff --git a/Backtracking/knight-tour.cpp b/Backtracking/knight_tour.cpp similarity index 78% rename from Backtracking/knight-tour.cpp rename to Backtracking/knight_tour.cpp index 978a2d34b..f1bc9f72f 100644 --- a/Backtracking/knight-tour.cpp +++ b/Backtracking/knight_tour.cpp @@ -1,5 +1,14 @@ #include # define n 8 + +/** +A knight's tour is a sequence of moves of a knight on a chessboard +such that the knight visits every square only once. If the knight +ends on a square that is one knight's move from the beginning +square (so that it could tour the board again immediately, following +the same path), the tour is closed; otherwise, it is open. +**/ + using namespace std; bool issafe(int x,int y,int sol[n][n]) {