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 is meant to work, can anyone make sense of this?
Sorry for being vague in my description here, it's just my understanding of what's happening is pretty vague too - I have no clue what the printf line is doing which seems pivotal to the whole function.