Skip to content

Improved linear search: return index, input validation, multpile queries #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inesh126
Copy link

@inesh126 inesh126 commented Jun 7, 2025

This pull request improves the existing linear search implementation by:

Changing the return value to the index of the found element instead of just 1/0, allowing users to know the exact position.

Adding input validation to handle edge cases, such as empty arrays.

Modifying the program to allow multiple search queries without restarting.

Enhancing code readability with comments and cleaner variable names.

These improvements make the linear search function more useful and the program more user-friendly.

@inesh126
Copy link
Author

inesh126 commented Jun 7, 2025

Hi, Im new here and this is my first PR
Id love to get to interact about anything and any helpful guidance
Thank You!

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.

1 participant