Question: Eight numbers in a cross. The problem was to write a program which allocates the integers 1-8 to the squares in the figure above, subject

Eight numbers in a cross.

The problem was to write a program which allocates the integers 1-8 to the squares in the figure above, subject to the restrictions that no two adjacent squares contain consecutive integers. By adjacent we mean vertically, horizontally, or diagonally.

 Eight numbers in a cross. The problem was to write a

ol Ql 2 subject to the restrictions that no two adjacent squares contain consecutive integers. By adjacent we meant vertically, horizontally, or diagonally The idea was to write a program which allocates the integers 1-8 to the squares in the figure above, We used an array int or8] to correspond to the sub-squares in the cross and the helper array a: int al8115)- 1 (0,-1. 2 10,-1, 10,1,2,-1 } C (2,3,4,-1}, ? {3,4,5,6,-1 } Question: 1. Using the aray a(8]5]. show which sub-square of the cross correspond to which value of array Q). Write your answer in the diagram above. Part 2 must be correct in order to get credit for part I. (5 points) 2. Explain in detail (and by example) how you determined this correspondence. (10 points) ol Ql 2 subject to the restrictions that no two adjacent squares contain consecutive integers. By adjacent we meant vertically, horizontally, or diagonally The idea was to write a program which allocates the integers 1-8 to the squares in the figure above, We used an array int or8] to correspond to the sub-squares in the cross and the helper array a: int al8115)- 1 (0,-1. 2 10,-1, 10,1,2,-1 } C (2,3,4,-1}, ? {3,4,5,6,-1 } Question: 1. Using the aray a(8]5]. show which sub-square of the cross correspond to which value of array Q). Write your answer in the diagram above. Part 2 must be correct in order to get credit for part I. (5 points) 2. Explain in detail (and by example) how you determined this correspondence. (10 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!