Solve the Tower of Hanoi Problem (Binary Solution) | Java
The problem involves moving a specified number of disks of distinct sizes from one tower to
another while observing the following rules:
There are n disks labeled 1, 2, 3, . . . , n and three towers labeled A, B, and C.
No disk can be on top of a smaller disk at any time.
All the disks are initially placed on tower A.
Only one disk can be moved at a time, and it must be the smallest disk on a tower.
** Binary Solution:
Disk positions determined more directly from the binary (base-2) representation of the move number
(the initial state being move #0, with all digits 0, and the final state being with all digits 1),
using the following rules:
one binary digit (bit) for each disk.
the leftmost significant bit represents the largest disk.
a bit with the same value as the previous one means that the corresponding disk is stacked on
the previous disk on the same tower.
a bit with a different value to the previous one means that the corresponding disk
(if number of disks is odd) is one position to right of the previous one.
(if number of disks is even), is two position to right of the previous one.
-* make the only legal move.
Auf dieser Seite können Sie das Online-Video Solve Tower of Hanoi Problem (Binary Solution) in Java mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer بروجرامنجي Programangy 24 April 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 222 Mal angesehen und es wurde von like den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!