MCPcopy Create free account
hub / github.com/CCCshengjiang/algorithm / func

Method func

data-structure-algorithm/src/cn/cwblue/dp/Hanoi.java:20–28  ·  view source on GitHub ↗
(int n, String left, String right, String other)

Source from the content-addressed store, hash-verified

18 }
19
20 private static void func(int n, String left, String right, String other) {
21 if (n == 1) {
22 System.out.println("move " + n + " from " + left + " to " + right);
23 return;
24 }
25 func(n - 1, left, other, right);
26 System.out.println("move " + n + " from " + left + " to " + right);
27 func(n - 1, other, right, left);
28 }
29}

Callers 1

hanoiMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected