Question: 5 dup-grid(grid) This function should duplicate a 2d array of integers. You may assume that it is 9x9 in size. It's important to make sure

 5 dup-grid(grid) This function should duplicate a 2d array of integers.You may assume that it is 9x9 in size. It's important to

5 dup-grid(grid) This function should duplicate a 2d array of integers. You may assume that it is 9x9 in size. It's important to make sure that the internal arrays you return are not aliases of the original data - they need to be new arrays! To check that, try out the following code snippet: orig - ... some grid ... copy = dup-grid(grid) copy[0][0] = 9 print (orig) print(copy) # should be different! 6 get_col(grid, x) This function takes a 9x9 grid. Don't make any assumptions about what sort of data it contains, but you can assume that it's arranged in the "array of columns" format. The x parameter is the column number; it will be in the range 0 through 8 (inclusive) Return all of the values in that column. Note that I don't care what order you return them, since I will be sorting your return values before I check them. 7 get_row(grid, y) This function is just like get_col(), except that this returns all of the values in a row. 8 get_square(grid, sx,xy) This function is just like get_col(), except that it returns the 9 values inside one of the squares of the grid. Remember, (0,0) is the upper-left square, and (2,0) is the upper-right

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!