Skip to content

Conversation

TejasSingh022
Copy link
Contributor

  • 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 77.43%. Comparing base (87ad52c) to head (1827b3f).

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.
📢 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
@DenizAltunkapan
Copy link
Member

@TejasSingh022 Please fix the failing workflows so I can start the review.

@TejasSingh022
Copy link
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.

Copy link
Member

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

my mistake. Thank you @TejasSingh022

@DenizAltunkapan DenizAltunkapan enabled auto-merge (squash) October 14, 2025 08:49
@DenizAltunkapan DenizAltunkapan merged commit a935710 into TheAlgorithms:master Oct 14, 2025
6 checks passed
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