Skip to content

Update linear_search.py #7621

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Vishwas1451
Copy link

@Vishwas1451 Vishwas1451 commented Oct 25, 2022

Describe your change:

I updated the linear search program
#6479

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • [x ] I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • [x ] I know that pull requests will not be merged if they fail the automated tests.
  • [x ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • [x ] All filenames are in all lowercase characters with no spaces or dashes.
  • [x ] All functions and variable names follow Python naming conventions.
  • [ x] All function parameters and return values are annotated with Python type hints.
  • [ x] All functions have doctests that pass the automated testing.
  • [ x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [x ] If this pull request resolves one or more open issues then the commit message contains Fixes: #6479 .

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 25, 2022
Comment on lines +30 to 33
for ind, itm in enumerate(sequence):
if itm == target:
return ind
return -1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trivial and I think this doesn't improve our code

Copy link
Member

@poyea poyea Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if you've any concern. Feel free to make other improvements!

@poyea poyea closed this Oct 25, 2022
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 enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants