Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The puzzle format As mentioned earlier, we will start with a completed puzzle stored in a four-element vector called puzzle where every element is itself

image text in transcribedimage text in transcribed

The puzzle format As mentioned earlier, we will start with a completed puzzle stored in a four-element vector called puzzle where every element is itself a four-element vector, such as 2 4 13 1 3 2 4 3 2 4 1 4 | 1 3 2 Each row of the puzzle will correspond to an element of a vector, e.g. the first row of the Pseudoku puzzle will be stored as a four-element vector, which itself is an element of a four-element vector. Therefore, this completed Pseudoku puzzle is represented by the following vector: Element 1 2 4 3 Element 2 1 3 2 4 Element 3 3 2 4 1 Element 4 4 3 2 We could make this vector by initiating a four-element vector, with each element being empty, and then assign a vector to each element. The goal of the algorithm in this coursework is to generate an unsolved Pseudoku puzzle from a row of four numbers. The first step in the process is to make all four elements of a four-element vector to be the same, and this element will be a four-element vector. For example, given a four-element vector with the numbers 2, 4, 1, 3, we produce the following vector: Element 1 2 Element 2 2 4 1 3 Element 3 2 4 1 3 Element 4 2 Your first task is to write a function in pseudocode that will carry out this process. Task 1: Complete the following function template: function MAKEVECTOR(row) new Vector puzzle(4) end function This function should take a four-element vector called row an input parameter and return a vector of four elements called puzzle: each element of puzzle should contain the four-element vector row. Complete this function

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_2

Step: 3

blur-text-image_3

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

9 What is meant by the processual approach?

Answered: 1 week ago