Added doctest & docstring to quadratic_probing.py#10996
Merged
cclauss merged 3 commits intoTheAlgorithms:masterfrom Oct 26, 2023
Merged
Added doctest & docstring to quadratic_probing.py#10996cclauss merged 3 commits intoTheAlgorithms:masterfrom
cclauss merged 3 commits intoTheAlgorithms:masterfrom
Conversation
cclauss
reviewed
Oct 26, 2023
Comment on lines
45
to
46
| reference: | ||
| - https://en.wikipedia.org/wiki/Quadratic_probing |
Member
There was a problem hiding this comment.
Let's put the URL above the tests so visitors can look at the tests and implementation without any visual clutter.
Contributor
Author
There was a problem hiding this comment.
@cclauss I made the changes as mentioned by you
cclauss
reviewed
Oct 26, 2023
| >>> qp.insert_data(111) | ||
| >>> qp.keys() | ||
| {0: 0, 7: 999, 3: 111} | ||
| """ |
Member
There was a problem hiding this comment.
Suggested change
| """ | |
| 3. Try to add three data elements when only two were provisioned | |
| >>> qp = QuadraticProbing(2) | |
| >>> qp.insert_data(0) | |
| >>> qp.insert_data(999) | |
| >>> qp.insert_data(111) | |
| ??? | |
| """ |
cclauss
approved these changes
Oct 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
Contributes to #9943
Checklist: