Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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). [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 straightfor- wardly 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago