Question: Please use PSEUDOCODE for solution Once we have a method for checking one column, we can use the following function to check all columns function

Please use PSEUDOCODE for solution Once we have a method for checkingPlease use PSEUDOCODE for solution

Once we have a method for checking one column, we can use the following function to check all columns function COLCHECKS(puzzle) for 1 si s 4 do if CHECKCOLUMN(puzzle, j) = FALSE then return FALSE end if end for return TRUE end function This will be useful later on. The next set of conditions to check is to see if all integers from 1 to 4 appear in the 2-by-2 sub-grids. In the next task, the goal is to replicate the approach of the function CHECKCOLUMN but for these sub-grids. In the function you should repeatedly call SEARCHSTACK for each element in a sub-grid, and then do this for all four sub-grids. Task 6: Complete the following function: function CHECKGRIDS(puzzle) end function This function will take the vector puzzle (as produced by MAKEVECTOR) as an input parameter and check that all sub-grids contain all numbers from 1 to 4: if every sub-grid does contain all numbers from 1 to 4, it should return TRUE, otherwise it should return FALSE. For each sub-grid you should create a stack with numbers from 1 to 4, and then repeatedly search the stack to see if the values in the sub-grid are stored there. To get full marks you need to call SEARCHSTACK(stack, item)

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!