Skip to content

Refactor LinearSearch to simplify null checks#7368

Open
YERRA-CHARAN wants to merge 3 commits intoTheAlgorithms:masterfrom
YERRA-CHARAN:patch-1
Open

Refactor LinearSearch to simplify null checks#7368
YERRA-CHARAN wants to merge 3 commits intoTheAlgorithms:masterfrom
YERRA-CHARAN:patch-1

Conversation

@YERRA-CHARAN
Copy link
Copy Markdown

@YERRA-CHARAN YERRA-CHARAN commented Apr 7, 2026

  • 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 algorithms include a corresponding test class that validates their functionality.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Copy link
Copy Markdown
Author

@YERRA-CHARAN YERRA-CHARAN left a comment

Choose a reason for hiding this comment

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

I had got the error and also fixed it please try with these changes. I think this one will help the upcoming contributors to understand the linear search more easily.
Thankyou.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.52%. Comparing base (49f9e1a) to head (cf340ea).

Files with missing lines Patch % Lines
.../java/com/thealgorithms/searches/LinearSearch.java 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7368   +/-   ##
=========================================
  Coverage     79.51%   79.52%           
  Complexity     7142     7142           
=========================================
  Files           796      796           
  Lines         23359    23358    -1     
  Branches       4596     4596           
=========================================
  Hits          18575    18575           
- Misses         4046     4047    +1     
+ Partials        738      736    -2     

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

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