Skip to content

Enhance linear_search and rec_linear_search with comprehensive doctests#14287

Closed
JesunAhmadUshno wants to merge 2 commits intoTheAlgorithms:masterfrom
JesunAhmadUshno:enhance-linear-search-doctests
Closed

Enhance linear_search and rec_linear_search with comprehensive doctests#14287
JesunAhmadUshno wants to merge 2 commits intoTheAlgorithms:masterfrom
JesunAhmadUshno:enhance-linear-search-doctests

Conversation

@JesunAhmadUshno
Copy link

Summary

Enhanced doctest coverage for both linear_search() and rec_linear_search() functions with comprehensive test examples covering:

  • Valid searches (first, middle, last elements)
  • Invalid searches (element not found)
  • Edge cases (empty list, single-element list)
  • Duplicates (finding first occurrence)
  • Negative numbers and various array sizes

Changes

  • Enhanced linear_search(): Added 11 new doctest examples (from 4 → 15 total)
  • Enhanced rec_linear_search(): Added 8 new doctest examples (from 4 → 12 total)
  • Improved docstrings to explain algorithm behavior
  • Added notes about recursive bounds checking
  • All tests pass locally

Checklist

  • I have read the CONTRIBUTING.md file
  • This is my own work and not plagiarized
  • My work will be distributed under the MIT License once merged
  • My submission follows the coding style and standards of this repository
  • I have tested my changes locally
  • All doctest examples pass
  • Code passes ruff linting

Copilot AI review requested due to automatic review settings February 17, 2026 11:05
@algorithms-keeper
Copy link

Multiple Pull Request Detected

@JesunAhmadUshno, we are extremely excited that you want to submit multiple algorithms in this repository but we have a limit on how many pull request a user can keep open at a time. This is to make sure all maintainers and users focus on a limited number of pull requests at a time to maintain the quality of the code.

This pull request is being closed as the user already has an open pull request. Please focus on your previous pull request before opening another one. Thank you for your cooperation.

User opened pull requests (including this one): #14286, #14285, #14284, #14283

@algorithms-keeper algorithms-keeper bot review requested due to automatic review settings February 17, 2026 11:06
@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant