-
Notifications
You must be signed in to change notification settings - Fork 21k
Add Tower of Hanoi recursive algorithm #7235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tower of Hanoi recursive algorithm #7235
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7235 +/- ##
============================================
- Coverage 79.32% 79.31% -0.01%
+ Complexity 6992 6990 -2
============================================
Files 781 781
Lines 22955 22958 +3
Branches 4509 4510 +1
============================================
+ Hits 18209 18210 +1
Misses 4020 4020
- Partials 726 728 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @DenizAltunkapan,@yanglbme, @alxkm |
|
@vizahat36 what is the difference between your solution and https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/puzzlesandgames/TowerOfHanoi.java ? |
|
Hi @DenizAltunkapan, thanks for the review. You’re right — there’s already a Both implementations use the standard Tower of Hanoi recursion, so the core algorithm is the same.
To keep it non-duplicative, I can:
Happy to update the PR this way, or close it if you feel it’s redundant. Please let me know what you prefer. |
|
@vizahat36 please make sure the repository only has one towerofhanoi class. You can update the existing version with more unit tests and concise docs, but keeping two classes is redundant in my opinion... |
|
Thanks for the clarification, @DenizAltunkapan — that makes sense. I’ll update the PR to remove the duplicate class and instead enhance the existing I’ll push the changes shortly. |
|
Thanks for the guidance, @DenizAltunkapan. |
|
@DenizAltunkapan |
Add Tower of Hanoi recursive algorithm
Description
Fixes #7223 (requested by @justanothercoder-hub).
This PR adds a professional, well-documented implementation of the Tower of Hanoi problem to the recursion module.
The solution demonstrates the classic recursive 3-step approach and adheres to all core problem constraints.
Features
Testing