Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Look at the previous tasks. Thank you The function PERMUTEVECTOR, once completed, will only cyclically permute one vector. The next task is to take

Please Look at the previous tasks. Thank you

image text in transcribed

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 right 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

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions