Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 7: Consider the following puzzle vector: Element 1 2 Element 2 1 3 2 Element 3 3 2 4 1 Element 4 4 1

image text in transcribed

Task 7: Consider the following puzzle vector: Element 1 2 Element 2 1 3 2 Element 3 3 2 4 1 Element 4 4 1 3 2 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. [6 marks] This seventh task is intentionally vague to allow for all sorts of creative solutions, as long as they are well explained. Putting everything together We now have all the ingredients to generate a solved puzzle given a row vector called row. The next task will in- volve generating the initial four-element vector called puzzle from row using MAKEVECTOR(row), trying all cyclic permutations (using PERMUTERow(puzzle, x, y, z) for all combinations of x, y and z) to see if the returned vector returns TRUE for both CHECKGRIDS and COLCHECKS

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

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago