Question: The function PermuteVector, once completed, will only cyclically permute one vector. The next task is to take a vector puzzle of the form returned by

The function PermuteVector, once completed, will only cyclically permute one vector. The next task is to take a vector puzzle of the form returned by the function MakeVector, and apply PermuteVector to each of the elements of puzzle. That is, given vector puzzle and three numbers x, y and z, elements 1, 2 and 3 of puzzle will be cyclically permuted x, y and z places to the left respectively.

Task 3: Complete the following function template: function PermuteRows(puzzle, x, y, z) ... end function This function should take a four-element vector called puzzle, which will be of the form of the output of MakeVector as an input parameter, as well as three integers x, y and z.The function will return puzzle but with elements puzzle[1], puzzle[2] and puzzle[3] cyclically permuted by x, y and z elements respectively to the left: x, y and z should all be numbers between 0 and 3 (inclusive). To be able to get full marks you should call the function PermuteVector appropriately. HINT: You do not need to loop over integers x, y and z.

Please do see the permutevector question in the link given to get an idea of the question. https://www.chegg.com/homework-help/questions-and-answers/cyclically-permute-values-repeat-multiple-times-process-enqueueing-value-head-dequeueing-f-q90835464?trackid=abefxIY4

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!