-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
base: master
Are you sure you want to change the base?
Refactor: merge ReverseStackUsingRecursion into ReverseStack and update tests (#6474) #6480
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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. |
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.