-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Create number container system algorithm #8808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create number container system algorithm #8808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
…aedenph/python into create-number-container-system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks cool!!
How does it perform on long lists of numbers?
from random import shuffle
numbers = list(range(10_000))
shuffle(numbers)
binary_search_delete(numbers, 5_000)
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
9bf70fe
to
82e1a0b
Compare
Good idea, I can add some timeit methods to show the scalability of this algorithm. Note that binary search requires a sorted array so shuffle cannot be used |
@cclauss I have added more tests to both insert and delete functions along with allowing not only list of ints but also strings and range objects. |
* feat: Create number container system algorithm * updating DIRECTORY.md * chore: Fix failing tests * Update other/number_container_system.py Co-authored-by: Christian Clauss <[email protected]> * Update other/number_container_system.py Co-authored-by: Christian Clauss <[email protected]> * Update other/number_container_system.py Co-authored-by: Christian Clauss <[email protected]> * chore: Add more tests * chore: Create binary_search_insert failing test * type: Update typehints to accept str, list and range --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
Describe your change:
Implements a number container system algorithm which stores indexes and numbers at these corresponding indexes.
Checklist:
Fixes: #{$ISSUE_NO}
.