[PR #1474] Improved linear search: return index, input validation, multpile queries #2080

Closed
opened 2026-01-29 15:28:27 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/TheAlgorithms/C/pull/1474

State: closed
Merged: No


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.

**Original Pull Request:** https://github.com/TheAlgorithms/C/pull/1474 **State:** closed **Merged:** No --- 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.
claunia added the pull-request label 2026-01-29 15:28:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#2080