Download
tower of hanoi n.
Skip this Video
Loading SlideShow in 5 Seconds..
Tower of Hanoi PowerPoint Presentation
Download Presentation
Tower of Hanoi

Tower of Hanoi

233 Vues Download Presentation
Télécharger la présentation

Tower of Hanoi

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Tower of Hanoi

  2. Members • 1.Krit Chandrema M.2/1 No.1 • 2.Pongsakorn Surapongwanitchakul M.2/1 No.5 • 3.Arituch Chainilpan M.2/1 No.16 • 4.Parit Prompuntjai M.2/1 No.27

  3. Pseudo code • 1. Start • 2. 5 rings and 3 bars • 3. Which bar will we move ring 1 to • 4. Bar C • 5. Ring 1 in the bar C • 6. Which bar will we move ring 2 to • 7. Bar B • 8. Ring 2 in the Bar B

  4. 9. Which bar will we move ring 1 to • 10. Bar B • 11. Ring 1 in the bar B • 12. Which bar will we move ring 3 to • 13. Bar C • 14. Ring 3 in the bar C • 15. Which bar will we move ring 1 to • 16 . Bar A • 17. Ring 1 in the bar A • 18. Which bar will we move ring 2 to • 19. Bar C • 20. Ring 2 in the bar C

  5. 21.Which bar we will move ring 1 to? • 22.Bar C • 23.Ring 1 in the bar C • 24.Which bar will we move ring 4 to? • 25.Bar C • 26.Ring 4 in the bar BC • 27.Which bar will we move ring 1 to? • 28.Bar A • 29.Ring 1 in the bar A • 30.Which bar will we move ring 2 to? • 31.Bar B • 32. Ring 2 in the bar B

  6. 33.Which bar will we move ring 1 to? • 34.Bar B • 35.Ring 1 in the bar B • 36.Which bar will we move ring 3 to? • 37.Bar A • 38.Ring 3 in the bar A • 39.Which bar will we move ring 1 to? • 40.Bar A • 41.Ring 1 in the Bar A • 42.Which bar will we move ring 2 to? • 43. Bar C • 44.Ring 2 in the bar C

  7. 45.Which bar will we move ring 1 to? • 46.Bar C • 47.Ring 1 in the bar C • 48.Which bar will we move ring 3 to? • 49.Bar B • 50.Ring 3 in the bar B • 51.Which bar will we move ring 1 to? • 52.Bar A • 53.Ring 1 in the bar A • 54.Which bar will we move ring 2 to? • 55.Bar B • 56.Ring 2 in the bar B

  8. 57.Which bar will we move ring 1 to? • 58.Bar B • 59.Ring 1 in the bar B • 60.Which bar will we move ring 5 to? • 61.Bar C • 62.Ring 5 in the bar C • 63.Which bar will we move ring 1 to? • 64.BarA • 65.Ring 1 in the bar A • 66.Which bar will we move 2 to? • 67.Bar C • 68.Ring 2 in the bar C

  9. 69.Which bar will we move 1 to? • 70.Bar C • 71.Ring 1 in the bar C • 72.Which bar will we move 3 to? • 73.Bar A • 74.Ring 3 in the bar A • 75.Which bar will we move ring 1 to? • 76.Bar B • 77.Ring 1 in the bar B • 78.Which bar will we move ring 2 to? • 79.Bar A • 80.Ring 2 in the bar A

  10. 81.Which bar will we move ring 1 to? • 82.Bar A • 83.Ring 1 in the bar A • 84.Which bar will move ring 4 to? • 85.Bar C • 86.Ring 4 in the bar C • 87.Which bar will we move ring 1 to? • 88.Bar C • 89. Ring 1 in the bar C • 90.Which bar will we move ring 2 to? • 91.Bar B • 92.Ring 2 in the bar B

  11. 93.Which bar will we move ring 1 to? • 94. Bar B • 95. Ring 1 in the bar B • 96. Which bar will we move ring 3 to? • 97.Bar C • 98.Ring 3 in the bar C • 99.Which bar will we move 1 to? • 100.Bar A • 101. Ring 1 in the bar A • 102.Which ring will we move ring 2 to? • 103.Bar C • 104.Ring 2 in the bar C

  12. 105.Which bar will we move ring 1 to? • 106.Bar C • 107.Ring 1 in the bar C • 108.Win • 109.End

  13. Start 5 rings and 3bars Which bar we will move ring 1 to? NO YES Bar C Bar B Ring 1 in the bar C

  14. Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B

  15. Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar B

  16. Which bar we will move ring 3 to? YES Bar C Bar B Ring 3 in the bar C

  17. Which bar we will move ring 1 to? YES Bar B Bar A Ring 1 in the bar A

  18. Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar C

  19. Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar C

  20. Which bar we will move ring 4 to? NO YES Bar C Bar B Ring 4 in the bar B

  21. Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A

  22. Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B

  23. Which bar we will move ring 1 to? YES NO Bar C Bar B Ring 1 in the bar B

  24. Which bar we will move ring 3 to? YES NO Bar B Bar A Ring 3 in the bar A

  25. Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A

  26. Which bar we will move ring 2 to? NO YES Bar C Bar B Ring 2 in the bar C

  27. Which bar we will move ring 1 to? NO YES Bar C Bar B Ring 1 in the bar C

  28. Which bar we will move ring 3 to? YES NO Bar C Bar B Ring 3 in the bar B

  29. Which bar we will move ring 1 to? YES NO Bar B Bar A Ring 1 in the bar A

  30. Which bar we will move ring 2 to? YES NO Bar C Bar B Ring 2 in the bar B