Skip to content

fix(searches): empty jump_search input; validate cyclic_sort - #15147

Open
felipeofdev-ai wants to merge 3 commits into
TheAlgorithms:masterfrom
felipeofdev-ai:fix/jump-search-empty-list-and-cyclic-sort-validation
Open

fix(searches): empty jump_search input; validate cyclic_sort#15147
felipeofdev-ai wants to merge 3 commits into
TheAlgorithms:masterfrom
felipeofdev-ai:fix/jump-search-empty-list-and-cyclic-sort-validation

Conversation

@felipeofdev-ai

@felipeofdev-ai felipeofdev-ai commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Test plan

  • python -m doctest searches/jump_search.py sorts/cyclic_sort.py
  • uvx ruff check sorts/cyclic_sort.py searches/jump_search.py
  • Manual check: jump_search([], 5) returns -1
  • Manual check: cyclic_sort([1, 1, 2]) raises ValueError

fix(sorts): validate cyclic_sort input to prevent infinite loops

Fixes TheAlgorithms#15085

Fixes TheAlgorithms#14898
@felipeofdev-ai
felipeofdev-ai force-pushed the fix/jump-search-empty-list-and-cyclic-sort-validation branch from c041e4b to b80d47d Compare September 1, 2026 14:37
@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Sep 1, 2026
@felipeofdev-ai
felipeofdev-ai force-pushed the fix/jump-search-empty-list-and-cyclic-sort-validation branch from 10cfe92 to 2fb19fb Compare September 1, 2026 14:45
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Sep 1, 2026
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.

bug(searches): jump_search raises IndexError for empty list input cyclic_sort.py has no input validation, causes infinite loop on invalid input

1 participant