06 July 2006

Multiple Assignment (1.1, 1)

Knuth asks
The text showed how to interchange the values of variables m and n, using the replacement notation, by setting t←m, m←n, n←t. Show how the values of four variables (a,b,c,d) can be rearranged to (b,c,d,a) by a sequence of replacements. In other words, the new value of a is to be the original value of b, etc. Try to use the minimum number of replacements.


Continued

0 Comments:

Post a Comment

<< Home