In the game of chess a knight in rownbsprnbspand


1. Consider the problem of placing eight queens on an (eight-by-eight) chess board. Two queens are said to attack each other if they are on the same row, column, or (not necessarily main) diagonal.

a. Give a randomized algorithm to place eight nonattacking queens on the board.

b. Give a backtracking algorithm to solve the same problem.

c. Implement both algorithms and compare the running time.

2. In the game of chess, a knight in row and column may move to row 1 ≤ Rt ≤ and column 1 ≤ Ct ≤ (where is the size of the board) provided that either

|Rt|= 2 and  |Ct|= 1 or

|Rt|= 1   and   |Ct|= 2

knight's tour is a sequence of moves that visits all squares exactly once before returning to the starting point.

a. If is odd, show that a knight's tour cannot exist.

b. Give a backtracking algorithm to ?nd a knight's tour.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: In the game of chess a knight in rownbsprnbspand
Reference No:- TGS01274781

Expected delivery within 24 Hours