Skip to content

Conversation

TejasSingh022
Copy link

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Description

Added TortoiseHareAlgo.java and its test.
Updated LinkedList documentation to include it.

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 line formatting build error
@TejasSingh022 TejasSingh022 marked this pull request as ready for review October 10, 2025 09:46
@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.65%. Comparing base (c691b31) to head (41214b4).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6722      +/-   ##
============================================
+ Coverage     76.60%   76.65%   +0.04%     
- Complexity     6026     6037      +11     
============================================
  Files           719      720       +1     
  Lines         20326    20360      +34     
  Branches       3937     3942       +5     
============================================
+ Hits          15571    15607      +36     
+ Misses         4164     4163       -1     
+ Partials        591      590       -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.

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

2 participants