Skip to content

Correct Treap split docstring to reflect actual working, Fixes: #7854#7899

Closed
utpalsavliya wants to merge 1 commit intoTheAlgorithms:masterfrom
utpalsavliya:7854-treap-not-working-expected-when-splitting-on-value-that-existed
Closed

Correct Treap split docstring to reflect actual working, Fixes: #7854#7899
utpalsavliya wants to merge 1 commit intoTheAlgorithms:masterfrom
utpalsavliya:7854-treap-not-working-expected-when-splitting-on-value-that-existed

Conversation

@utpalsavliya
Copy link

@utpalsavliya utpalsavliya commented Oct 31, 2022

Corrected the split docstring to reflect the working of the function, i.e., elements equal to the split value will be contained by left subtree, which before correction the docstring stated to be contained in the right subtree.

Describe your change:

Implemented the suggestion by @vbvg2008 for issue #7854 to correct the docstring. Didn't choose to modify the code as stated in the latter part of suggestion as I found couple of resources online which kept the elements equal to the key in left subtree, supporting the former part of the suggestion.
Links to resources -
https://cp-algorithms.com/data_structures/treap.html#implicit-treaps
https://medium.com/carpanese/a-visual-introduction-to-treap-data-structure-part-1-6196d6cc12ee

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

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. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all 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 functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

…ms#7854

Corrected the split docstring to reflect the working of the function, i.e., elements equal to the split value will be contained by left subtree, which before correction the docstring stated to be contained in the right subtree.
@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 31, 2022
@utpalsavliya utpalsavliya changed the title Correct split docstring to reflect actual working, Fixes: #7854 Correct Treap split docstring to reflect actual working, Fixes: #7854 Oct 31, 2022
@cclauss cclauss added ON HOLD: Final hours of Hacktoberfest We will review this PR after Hacktoberfest has ended and removed ON HOLD: Final hours of Hacktoberfest We will review this PR after Hacktoberfest has ended labels Oct 31, 2022
@cclauss cclauss closed this Sep 30, 2023
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