Offkilterbike - Tin Dành Cho Những Tín Đồ Đam Mê Tìm Hiểu Về Xe Cộ
  • Home
  • Du Lịch
No Result
View All Result
  • Home
  • Du Lịch
No Result
View All Result
Offkilterbike - Tin Dành Cho Những Tín Đồ Đam Mê Tìm Hiểu Về Xe Cộ
No Result
View All Result
Home Du Lịch

Recursion Algorithm | Tower Of Hanoi – step by step guide

admin by admin
July 29, 2020
in Du Lịch
38
Recursion Algorithm | Tower Of Hanoi – step by step guide
0
SHARES
7
VIEWS
Share on FacebookShare on Twitter



Tower of Hanoi is a very famous game. In this game there are 3 pegs and N number of disks placed one over the other in decreasing size. The objective of this game is to move the disks one by one from the first peg to the last peg. And there is only ONE condition, we can not place a bigger disk on top of a smaller disk.

Tutorial and Code:

In this video we will learn to solve Tower Of Hanoi recursively by taking minimum number of moves.

0:03 About Tower Of Hanoi
0:18 Important rule to follow while solving Tower Of Hanoi
0:25 The three pegs of Tower Of Hanoi labeled A, B and C
0:33 The 3 disks in decreasing size from bottom to top
0:38 Objective of the game
0:51 How to solve Tower Of Hanoi
0:58 The general notation used to solve the Tower Of Hanoi problem recursively
1:15 The 3 steps to follow recursively to solve Tower Of Hanoi
1:50 Solving the game with 3 disks
2:05 Calculating the minimum number of moves to solve Tower Of Hanoi recursively
2:10 Solving T(3, A, B, C)
3:05 Solving T(2, A, C, B)
3:58 Solving T(2, B, A, C)
4:55 So we have the moves. Lets see them in action!
6:10 Solved!
6:15 Algorithm of Tower Of Hanoi (Recursive)
6:42 Calculating minimum number of moves to solve Tower Of Hanoi having N disks

Related Videos
Factorial
Fibonacci

You can download the code from my GitHub repository

To know more about Pseudo code kindly watch this video

Thanks 🙂

Nguồn: https://offkilterbike.com

Xem thêm bài viết khác: https://offkilterbike.com/du-lich/

Xem thêm Bài Viết:

  • 10 khu nghỉ dưỡng tốt nhất ở Utah
  • Kinh nghiệm du lịch Thái Lan mùa đông 2022
  • Từ vựng tiếng Anh thông dụng khi đi du lịch Thái Lan | Hochay | Từ vựng tiếng Anh
  • Du lịch Cao Nguyên Đồng Cao Bắc Giang | Du lịch Bắc Giang
  • ? Câu mực đêm ở PHÚ QUỐC – ăn hải sản chợ đêm Phú Quốc | DU LỊCH PHÚ QUỐC (1/3) Hoa N Don
Previous Post

TRANG BỊ QUỐC DÂN LMHT THẾ HỆ MỚI: KIẾM MANAMUNE!

Next Post

Sleeping Dogs - Tập 16 - Tôn Ngộ Không Dẹp Loạn Giang Hồ | Big Bang

admin

admin

Next Post
Sleeping Dogs – Tập 16 – Tôn Ngộ Không Dẹp Loạn Giang Hồ | Big Bang

Sleeping Dogs - Tập 16 - Tôn Ngộ Không Dẹp Loạn Giang Hồ | Big Bang

Comments 38

  1. jet fuel says:
    2 years ago

    Excellent representation. Well done

    Reply
  2. Deep Rooted says:
    2 years ago

    Nice !

    Reply
  3. Jeriah Bernard says:
    2 years ago

    I found out to do this in a minute. No joke.

    Reply
  4. Ricky Z says:
    2 years ago

    was literally expecting an Indian accent

    Reply
  5. Youness Eddaa says:
    2 years ago

    Wonderful it really help me to find the complexity of Tower of Hanoi Thankyou so much

    Reply
  6. reezyyy says:
    2 years ago

    Finally got this! Thank you so much!!!

    Reply
  7. surya i says:
    2 years ago

    Tomorrow exam

    Reply
  8. Onur Demir says:
    2 years ago

    thank you . ı tangled ı haven t consider this is quite easy

    Reply
  9. Yasmeen karachiwala says:
    2 years ago

    Amazing! Thank you very much!!!

    Reply
  10. G0B00K says:
    2 years ago

    Bhai kuch bol bhi le ??

    Reply
  11. Luka Kiwi says:
    2 years ago

    Hi! I'm from Argentina. I tried to figure out my self this algorithm, but I couldn't. But I think I actually figured out the formula in the end, the one that returns the minimum of movements to solve a level. But my formula is different! (Also is less useful, but well I'm only a secondary student haha). Mine it's like this:

    T(n) = 2T(n-1) + 1

    T it's the "tower of disks" and n is the number on disks. For example, as you said, the minimum movements for a 3 disks tower is 7. For a tower of 4 disks, It will be 15 movements (7×2+1). For a tower of 5, 31 movements. 6 disks, 63 movements…. And so on. I discovered another things but I don't want to make really long comment so I will stop here :). Very good video, loved it!

    Reply
  12. Faizan Ahmed Siddiqui says:
    2 years ago

    Amazing. Loved it

    Reply
  13. Atomix says:
    2 years ago

    Your are a god

    Reply
  14. Guesswhat says:
    2 years ago

    3 is easy but not 7

    Reply
  15. Peaceful Kitchen says:
    2 years ago

    Who coming because of the silly game?

    Reply
  16. ATXpert says:
    2 years ago

    cant you just move the top one on the left to the close right each time, and when finished, move the top middle to the close right side everytime its solved isnt it?

    Reply
  17. bilal imran says:
    2 years ago

    this is wrong, you have wrote Aux=A in beginning than in the middle you changed it into Aux=C why???????

    Reply
  18. damesftw45 says:
    2 years ago

    How is it you know you have made correct moves prior to the completion of the recursion? I'm thinking you put a lot of knowledge in your algorithm rather than letting the recursion do the work. Which I suppose is fine, but I would have preferred an exhaustive analysis that uses the recursion instead of using knowledge of the problem to solve it. Yes, this is more clever, and such, but it's not a great example of recursion, IMO.

    Reply
  19. Timothy R.Pachuau says:
    2 years ago

    One of the best I've seen so far.

    Reply
  20. MOHSIN KHAN says:
    2 years ago

    Ise kahte Bina bole isaro me samjhana

    Reply
  21. Ahmed Sheets says:
    2 years ago

    Great, Thanks

    Reply
  22. shruthi gowni says:
    2 years ago

    Nice video

    Reply
  23. Ali Anwar says:
    2 years ago

    It's the best out on YT.

    Reply
  24. joshua glepko says:
    2 years ago

    How is it move A -> C ??

    Reply
  25. Rohini Sushmitha says:
    2 years ago

    No sound….but nice video

    Reply
  26. SAGAR VARSHNEY says:
    2 years ago

    The best explanation of tower of honoi puzzle….on youtube…..

    Reply
  27. MultirotorKnowledge says:
    2 years ago

    You are the only who explained well each step for the resolution of the Tower of Hanoi and how to get the moves. Nice video, thank you.

    Reply
  28. Burnt Stove says:
    2 years ago

    thank you mister

    Reply
  29. ARUNA DEEPTHI says:
    2 years ago

    Tq u so much sir. I've seen many videos of this game but no video is in detailed explanation as udid even without sounds

    Reply
  30. Amjad Sultan says:
    2 years ago

    Yusuf great effort. Keep it up.

    Reply
  31. Daksha Sindal says:
    2 years ago

    ?A guy demonstrates..Working example of Tower of Hanoi. https://youtu.be/KUgBiQpMkZI

    Reply
  32. sayali desai says:
    2 years ago

    Seriously osm ????

    Reply
  33. Nikunj Krishna Rayal says:
    2 years ago

    I thought, I have some hearing problem

    Reply
  34. Meh-Tyu says:
    2 years ago

    So sorry, dozed off for a moment. Seriously, this could not possibly be any more boring.

    Reply
  35. Kingfa Luis says:
    2 years ago

    It's easy to understand , very good.

    Reply
  36. Peizhi Yan says:
    2 years ago

    Excellent!

    Reply
  37. Rahmat Dicky says:
    2 years ago

    Very helpful! Thanks!

    Reply
  38. ashesh gaur says:
    2 years ago

    apke is jazbe ko hum salaam karte hain (bow)

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

10 khu nghỉ dưỡng tốt nhất ở Utah

December 6, 2022
Kinh nghiệm du lịch Thái Lan mùa đông 2022

Kinh nghiệm du lịch Thái Lan mùa đông 2022

December 6, 2022
Từ vựng tiếng Anh thông dụng khi đi du lịch Thái Lan | Hochay | Từ vựng tiếng Anh

Từ vựng tiếng Anh thông dụng khi đi du lịch Thái Lan | Hochay | Từ vựng tiếng Anh

August 12, 2020
Du lịch Cao Nguyên Đồng Cao Bắc Giang | Du lịch Bắc Giang

Du lịch Cao Nguyên Đồng Cao Bắc Giang | Du lịch Bắc Giang

August 12, 2020
? Câu mực đêm ở PHÚ QUỐC – ăn hải sản chợ đêm Phú Quốc | DU LỊCH PHÚ QUỐC (1/3) Hoa N Don

? Câu mực đêm ở PHÚ QUỐC – ăn hải sản chợ đêm Phú Quốc | DU LỊCH PHÚ QUỐC (1/3) Hoa N Don

August 12, 2020
LỄ TỔNG KẾT KHÓA TU THIỀN CHÙA TỪ TÂN

LỄ TỔNG KẾT KHÓA TU THIỀN CHÙA TỪ TÂN

August 12, 2020

offkilterbike-logo

offkilterbike.com – chuyên trang được xây dựng với định hướng chia sẻ những kiến thức chuyên sâu về xe cộ, cách lựa chọn xe cùng những mẫu xe độ đẹp trên thế giới

  • Liên Hệ
  • Chính Sách Bảo Mật

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Du Lịch

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.