Skip to content

docs: improve LinearSearch Javadoc with step-by-step explanation and examples#7339

Open
NajoroRabiaza wants to merge 2 commits intoTheAlgorithms:masterfrom
NajoroRabiaza:improve-linearsearch-docs
Open

docs: improve LinearSearch Javadoc with step-by-step explanation and examples#7339
NajoroRabiaza wants to merge 2 commits intoTheAlgorithms:masterfrom
NajoroRabiaza:improve-linearsearch-docs

Conversation

@NajoroRabiaza
Copy link

Closes #7334

The LinearSearch implementation was correct but the documentation
was minimal. This PR improves the Javadoc to help beginners understand
how the algorithm works.

Changes made:

  • Added a step-by-step explanation of how the algorithm works

  • Added a concrete example that traces the execution index by index

  • Added a "not found" example with return value -1

  • Added time and space complexity explanation

  • Improved the find() method Javadoc

  • 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

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.45%. Comparing base (2927595) to head (b97892a).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7339   +/-   ##
=========================================
  Coverage     79.45%   79.45%           
  Complexity     7082     7082           
=========================================
  Files           790      790           
  Lines         23161    23161           
  Branches       4556     4556           
=========================================
  Hits          18403    18403           
  Misses         4022     4022           
  Partials        736      736           

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

@NajoroRabiaza NajoroRabiaza marked this pull request as ready for review March 26, 2026 15:21
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.

Improve documentation for LinearSearch implementation

2 participants