Consider an algorithm that uses only assignment statements that replaces the quintuple (v, w, x, y, z) with (w, x, y, z, v). What is the minimum number of assignment statements needed?
So you need to shift everything to left by 1 position
i dont understand
is the answer 1?
(v, w, x, y, z) with (w, x, y, z, v). ``` a=v v=w w=x x=y y=z z=a ```
im guessing you will need 6 assign statements in above sequence ^
were does a come in to the equation
it is a temporary variable to save the contents of `v`
oh k so i still dont understand what the answer would be
you need a minimum of 6 assignments if you work it like above
can you explain it i dont learn by some one saying I need the steps to figure it out
assignments are always destructive. they replace the contents of the variable with a new value. therefore it is impossible to preserve all the data without a temporary variable.
ok
Now check ganeshie8's list of assignments and confirm for yourself that it does indeed work.
i would assume that it would because a would logically be the next letter after z
The name \(a\) is arbitrary, it could be anything. You could actually name it \(temp\) if you like.
so now that i understand it how do i write the answer by 6 or the vxyza
@Alchemista I understand the equation but how do I write the answer
Join our real-time social learning platform and learn together with your friends!