the well known hanoi tower algorithm is as follow:(adsbygoogle = window.adsbygoogle || []).push({});

my problem is : can we handle this algorithm in this method?Code (Text):

public static void hanoi(int n,int a,int b,int c)

(

if(n>0)

(

hanoi(n-1,a,c,b);

move(a,b);

hanoi(n-1,c,b,a);

)

)

we can regard three places as one place which means that three places' case is the basic case, then we can solve the problem of nine places where three places are regarded as one place, and so on, we can solve the case of 27 places then to the case of places. if we realized that when we move three places, it means that we move 7 times which time we move one place, in this way we can solve the problem with remainder.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Can we view the hanoi tower algorithm as the following way?

Loading...

Similar Threads - view hanoi tower | Date |
---|---|

C/++/# Don't understand tower of Hanoi Program Stack | Feb 10, 2017 |

Viewing a webpage means downloading it? | Jan 16, 2016 |

Changing Names in an SQL View | May 18, 2015 |

4 Pegs Hanoi Tower | May 9, 2015 |

**Physics Forums - The Fusion of Science and Community**