Skip to content

fix: add input validation to cyclic_sort to prevent infinite loop - #15026

Open
deepshekhardas wants to merge 1 commit into
TheAlgorithms:masterfrom
deepshekhardas:fix/algo-14898-cyclic-validation
Open

fix: add input validation to cyclic_sort to prevent infinite loop#15026
deepshekhardas wants to merge 1 commit into
TheAlgorithms:masterfrom
deepshekhardas:fix/algo-14898-cyclic-validation

Conversation

@deepshekhardas

Copy link
Copy Markdown

Describe your change

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add, change, or clarify documentation?

What does this implement/fix?

Validates that the list contains only distinct elements, since cyclic_sort loops forever on duplicates.

Additional comments?

None.

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.

1 participant