- Backtracking, chessboard-problems, Matrix, Recursion, TrueGeek

Print all Knight’s tour possible from a starting point on NxN chessboard

#include using namespace std;  int DirX[] = { 2, 1, -1, -2, -2, -1, 1, 2 };int DirY[] = { 1, 2, 2, 1, -1, -2, -2, -1 };  bool isSafe(int i, int j, int n,            vector& Board){    return (i >= 0 and j >= 0 and i < n and j < n            and Board[i][j] == 0);}  bool isPossible = false;  void knightTour(vector& ChessBoard, int N,                int x, int y, int visited = 1){        ChessBoard[x][y] = visited;              if (visited == N * N) {        isPossible = true;                  for (int i = 0; i < N; i++) {            for (int j = 0; j < N; j++) {                cout