Skip to content

Add option to return index in linear search#1563

Open
darshan2456 wants to merge 1 commit intoTheAlgorithms:masterfrom
darshan2456:linear_search_return_idx
Open

Add option to return index in linear search#1563
darshan2456 wants to merge 1 commit intoTheAlgorithms:masterfrom
darshan2456:linear_search_return_idx

Conversation

@darshan2456
Copy link
Copy Markdown

Resolves #1544

I changed the linear_search() to return index and -1 if element is not found. I am taking user input as to if they want to see the index and as per user input, i have branched the execution flow with a simple if statement.

  • Added description of change
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OTHER] Linear search not returning index

1 participant