0 penilaian0% menganggap dokumen ini bermanfaat (0 suara)
3 tayangan1 halaman
This document provides steps to calculate the number of disks and moves in the Tower of Hanoi problem. It explains that the number of moves (m) is equal to 2^n - 1, where n is the number of disks. It also provides a formula to calculate n (the number of disks) from m (the number of moves) by taking the log base 2 of m+1. The document then gives an example of using these formulas to calculate n from a given m of 511. It concludes by outlining the three steps of the Tower of Hanoi algorithm to transfer n disks from one rod to another.
This document provides steps to calculate the number of disks and moves in the Tower of Hanoi problem. It explains that the number of moves (m) is equal to 2^n - 1, where n is the number of disks. It also provides a formula to calculate n (the number of disks) from m (the number of moves) by taking the log base 2 of m+1. The document then gives an example of using these formulas to calculate n from a given m of 511. It concludes by outlining the three steps of the Tower of Hanoi algorithm to transfer n disks from one rod to another.
This document provides steps to calculate the number of disks and moves in the Tower of Hanoi problem. It explains that the number of moves (m) is equal to 2^n - 1, where n is the number of disks. It also provides a formula to calculate n (the number of disks) from m (the number of moves) by taking the log base 2 of m+1. The document then gives an example of using these formulas to calculate n from a given m of 511. It concludes by outlining the three steps of the Tower of Hanoi algorithm to transfer n disks from one rod to another.