Question: Task 6: Complete the following function: function CheckGrids(puzzle) end function This function will take the vector puzzle (as produced by VECTOR) as an input parameter

 Task 6: Complete the following function: function CheckGrids(puzzle) end function This

Task 6: Complete the following function: function CheckGrids(puzzle) end function This function will take the vector puzzle (as produced by VECTOR) 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). [6 marks] Implementing the puzzle vectors A vector is an abstract data structure. When a vector just stores only a number in each element, we can straightforwardly implement the vector with an array where each element of the array stores a number. However, the vectors considered in this assignment store vectors in their elements. The next task in the assignment is to design a concrete data structure for implementing the puzzle vectors representing Pseudoku puzzles; importantly, each element of the concrete data structure can only store a number or a pointer. Therefore, you could try an implementation based on arrays or linked lists, or a hybrid of both. Task 7: Consider the following puzzle vector: Design and explain a concrete data structure that implements this puzzle vector. The data structure must only consist of elements that can store an integer or a pointer to another element or null - elements can be indexed if they are contiguous in memory as with an array. You can draw the data structure and explain how the allowed operations of vectors are implemented on this concrete data structure - additional pointers can be created to traverse lists. One approach could be to use arrays, or linked lists, or another approach completely

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!