Do you know temp?
This script is very easy one.
temp = a
a = b
b = temp
This is major algorithm.
The exchange algorithm.
Why is a=b, and b=a bad?
The a is a.
The a=b process is that a is changed by b.
So, a is not a.
After that, insert a value to b, just b can be b.
Thus, we use temp variable.
The temp is a memory cage.
The a’s memory cage.
Just it.
Do so, you can exchange the value of a and b.
Do you know it?
Thanks.
That’s it.
Comments
Post a Comment