Skip to content

Refactor: merge ReverseStackUsingRecursion into ReverseStack and update tests (#6474) #6480

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

Closed

Conversation

VickySource
Copy link
Contributor

Deleted ReverseStackUsingRecursion.java and ReverseStackUsingRecursionTest.java.

Moved the recursive stack reversal method into ReverseStack.java.

Updated ReverseStackTest.java to include:

Null stack test using assertThrows for IllegalArgumentException.

Tests for empty, single-element, two-element, and multi-element stacks.

Verification that stack size remains unchanged after reversal.

Ensured all tests follow JUnit 5 conventions and project formatting.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.09%. Comparing base (0ff2c06) to head (d7eed5b).

Files with missing lines Patch % Lines
...algorithms/datastructures/stacks/ReverseStack.java 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6480      +/-   ##
============================================
- Coverage     75.11%   75.09%   -0.03%     
+ Complexity     5575     5570       -5     
============================================
  Files           687      686       -1     
  Lines         19318    19307      -11     
  Branches       3732     3732              
============================================
- Hits          14511    14498      -13     
- Misses         4245     4246       +1     
- Partials        562      563       +1     

☔ 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.

Copy link
Collaborator

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation that both classes follow the same approach. 👍 Please resolve the remaining issues so we can proceed with the merge. @VickySource

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this file? Please revert this deletion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out — I’ll restore the file. I had removed it because it seemed duplicate, but I’ll revert the deletion as requested.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please solve the linting issues in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — I’ll fix the linting issues and update the PR.

@VickySource
Copy link
Contributor Author

Thanks for the review and the detailed feedback! I’ll revert the deleted file, address the linting issues, and double-check the null stack handling. I’ll push the updates tomorrow.

@VickySource VickySource closed this by deleting the head repository Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants