Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for the 8 numbers in a cross. Im not understanding how I got a wrong. From my understanding we're suppose to place the
This is for the 8 numbers in a cross. Im not understanding how I got a wrong. From my understanding we're suppose to place the numbers that are presented in the helper array, and according placethe numbers that belong in each square of the cross. I thought i did it correctly. If not I would love any corrections. Also how would you go about b? thank you.
13. One of the projects we worked on this semester is "Eight Numbers in a Cross." The idea 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 meant vertically, horizontally, or diagonally. We used an array int Q[8] to correspond to the sub-squares in the cross and the helper array a: int a[8][5]=\{ {1}, {0,1}, {0,1}, {0,1,2,1}, {0,1,3,1}, {1,4,1}, {2,3,4,1}, {3,4,5,6,1} \} Question: a. Using the array a [8][5], show which sub-square of the cross correspond to which value of array Q[]. Write your answer in the diagram above. (5 points) b. Explain in detail (and by example) how you determined this correspondence. (10 points)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started