Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Tower of Hanoi recursion solution#7173

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kamakshipal1-tech wants to merge5 commits intoTheAlgorithms:master
base:master
Choose a base branch
Loading
fromkamakshipal1-tech:master

Conversation

@kamakshipal1-tech
Copy link

(Description template was accidentally removed.)

📌 Description

This pull request adds arecursive implementation of the Tower of Hanoi problem in Java.

What is included:

  • Clean and readable Java code
  • Proper base case and recursive logic
  • Clear print statements showing each disk move
  • Time and space complexity mentioned in comments

Why this change:

  • To practice recursion concepts
  • To contribute a classic DSA problem solution
  • To improve code readability and learning value

Complexity:

  • Time Complexity: O(2^n)
  • Space Complexity: O(n) (recursion stack)

I would appreciate feedback on:

  • Code readability
  • Comments and naming
  • Any possible improvements

Thank you for reviewing! 🙌

📌 Description

This pull request adds arecursive implementation of the Tower of Hanoi problem in Java.

What is included:

  • Clean and readable Java code
  • Proper base case and recursive logic
  • Clear print statements showing each disk move
  • Time and space complexity mentioned in comments

Why this change:

  • To practice recursion concepts
  • To contribute a classic DSA problem solution
  • To improve code readability and learning value

Complexity:

  • Time Complexity: O(2^n)
  • Space Complexity: O(n) (recursion stack)

I would appreciate feedback on:

  • Code readability
  • Comments and naming
  • Any possible improvements

Thank you for reviewing! 🙌

@codecov-commenter
Copy link

codecov-commenter commentedDec 17, 2025
edited
Loading

Codecov Report

❌ Patch coverage is0% with7 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.87%. Comparing base (b76962d) to head (db3da53).
⚠️ Report is 3 commits behind head on master.

Files with missing linesPatch %Lines
...java/com/thealgorithms/recursion/TowerOfHanoi.java0.00%7 Missing⚠️
Additional details and impacted files
@@             Coverage Diff              @@##             master    #7173      +/-   ##============================================- Coverage     78.91%   78.87%   -0.04%- Complexity     6853     6858       +5============================================  Files           769      772       +3       Lines         22668    22693      +25       Branches       4456     4456              ============================================+ Hits          17888    17899      +11- Misses         4067     4079      +12- Partials        713      715       +2

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kamakshipal1-tech
Copy link
Author

Thanks for the checks! I’ll fix the clang-format issue and update the PR shortly.

@kamakshipal1-tech
Copy link
Author

I initially had only a clang-format failure.
While attempting to resolve it locally, additional build failures appeared.
I believe this is due to formatting/tooling issues rather than logic.
Guidance or maintainer-applied formatting would be appreciated.
Thank you.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DenizAltunkapanDenizAltunkapanAwaiting requested review from DenizAltunkapanDenizAltunkapan is a code owner

@yanglbmeyanglbmeAwaiting requested review from yanglbmeyanglbme is a code owner

@alxkmalxkmAwaiting requested review from alxkmalxkm is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@kamakshipal1-tech@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp