The algorithm is as follows:
Algorithm move(k, from, to, spare) if k >0 then move(k−1, from, spare, to) printf ("move top disc from %d to %d\n", from, to) move(k−1, spare, to, from)
k is the number of disks (http://en.wikipedia.org/wiki/Tower_of_Hanoi). I understand recursion, I just don’t understand how this should work, can anyone understand this?
Sorry for the nebula in my description here, just my understanding of what is happening is also rather vague - I don't know what the printf line does, which seems key to the whole function.
source share