How do you solve the Towers of Hanoi puzzle when there are k pegs? Can it be done in an optimal way in C? Is there a greedy algorithm for it?
See this github page for the code in C: https://github.com/kcolford/hanoi/blob/master/src/hanoi.c
See this page to know why it's minimal: http://kcolford.com/the-towers-of-hanoi-2/