Add TortoiseHareAlgo implementation with append, toString, and getMiddle methods#6722
Merged
DenizAltunkapan merged 12 commits intoTheAlgorithms:masterfrom Oct 14, 2025
Merged
Conversation
Implement TortoiseHareAlgo with append, getMiddle, and toString methods - Added generic singly linked list with inner Node class - Implemented append() to add elements - Implemented getMiddle() using Tortoise-Hare approach - Added toString() for readable list representation
Add JUnit tests for TortoiseHareAlgo - Verified append() and toString() output - Tested getMiddle() for odd, even, and empty lists - Ensured correct behavior and null handling
Add TortoiseHareAlgo to linked list documentation - Added TortoiseHareAlgo.java to file descriptions - Described its purpose: finding middle element using Tortoise-Hare algorithm
Fixed build error
Fixed line formatting build error
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6722 +/- ##
============================================
+ Coverage 77.39% 77.43% +0.03%
- Complexity 6240 6250 +10
============================================
Files 723 724 +1
Lines 20839 20873 +34
Branches 4064 4069 +5
============================================
+ Hits 16129 16162 +33
Misses 4076 4076
- Partials 634 635 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixed line formatting build error
Added {} after if statement instead of directly writing statement
Fixed line formatting build error
Added {} after if statement instead of directly writing statement
Replace .* import with specific imports
Member
|
@TejasSingh022 Please fix the failing workflows so I can start the review. |
Contributor
Author
|
The build is failing due to a test file (BloomFilterTest) that I didn’t modify. My code file functions correctly and doesn’t cause this error. |
DenizAltunkapan
approved these changes
Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clang-format -i --style=file path/to/your/file.javaDescription
Added TortoiseHareAlgo.java and its test.
Updated LinkedList documentation to include it.