![]() Number the discs from 1 (smallest, topmost) to n (largest, bottommost) Label the pegs A, B, C-these labels may move at different steps The following procedure demonstrates this approach. Move(n,”source tower”,”intermediate tower”,”destination tower”) Ī key to solving this puzzle is to recognize that it can be solved by breaking the problem down into a collection of smaller problems and further breaking those problems down into even smaller problems until a solution is reached. ![]() move n-1 disks from source to intermediate tower > Works in Microsoft VC++ 6.0, windows xp. ![]() > This C++ program is to solve the towers of hanoi problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |