The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Question 5. (15 marks)
You are given a n x n-chess board, on which two bishops | one
white and one black | are placed on two dierent white squares. (The
bishop chess piece only moves diagonally for any number of squares.)
You take turns alternating between moving the white bishop and
the black bishop. You cannot move a bishop to a square where it
might be captured by the opposite-color piece. So, for example, in the
situation detailed in Figure 1 you can move the black bishop to any square along the blue arrows except for the two squares marked by
a red-X, as in those two red squares it can be captured by the white
bishop.
Design an algorithm that takes as an input the starting positions
of the two black and white bishops and the end positions, and nds
a shortest sequence of moves that takes the bishops to their end-
positions. What is the runtime of your algorithm?
Â
Â
Question 5. (15 marks) You are given a n X n—chess board, on which two bishops 7 one
white and one black 7 are placed on two different white squares. (The
bishop chess piece only moves diagonally for any number of squares.) You take turns alternating between moving the white bishop and
the black bishop. You cannot move a bishop to a square where it
might be captured by the opposite—color piece. So, for example, in the
situation detailed in Figure 1 you can move the black bishop to any
-----------