Skip to content

Commit e7e5263

Browse files
Nikhilesh SatishNikhilesh Satish
authored andcommitted
Solution for Tower of Hanoi problem using recursion
1 parent 026f27a commit e7e5263

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/thealgorithms/recursion/TowerOfHanoi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
/*Tower of Hanoi Problem on Wikipedia - https://en.wikipedia.org/wiki/Tower_of_Hanoi */
44

55
public final class TowerOfHanoi {
6-
private TowerOfHanoi(){}
6+
private TowerOfHanoi() {
7+
}
78
public static void solveHanoi(int n, char src, char dest, char aux) {
89
if (n == 1) {
910
System.out.println("Move disk 1 from " + src + " to " + dest);

0 commit comments

Comments
 (0)