Skip to content

Add edge cases for equilibrium index - #15372

Merged
cclauss merged 3 commits into
TheAlgorithms:masterfrom
NeuroByte79:contribution/my-first-python-pr
Sep 17, 2026
Merged

cclauss merged 3 commits into
TheAlgorithms:masterfrom
NeuroByte79:contribution/my-first-python-pr

Conversation

@NeuroByte79

Copy link
Copy Markdown
Contributor

Describe your change

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

Added additional doctests for the equilibrium index function to improve edge-case coverage.

Changes

  • Added single-element array test.
  • Added all-zero array test.
  • Added negative-elements array test.
  • Added mixed positive and negative elements test.
  • Documented time and space complexity.

Testing

  • Ran the doctest suite successfully.
  • All tests passed.

Checklist

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work — I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file.
  • All new Python files are placed inside an existing directory.
  • All filenames are in lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All doctests pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Sep 17, 2026
Updated docstring examples and formatting for clarity.
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Sep 17, 2026
@cclauss
cclauss merged commit a381578 into TheAlgorithms:master Sep 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants