-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add skip list #954
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
Add skip list #954
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #954 +/- ##
==========================================
+ Coverage 95.39% 95.43% +0.04%
==========================================
Files 332 335 +3
Lines 21496 21797 +301
==========================================
+ Hits 20506 20803 +297
- Misses 990 994 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@imp2002 Hey, could you give me some feedback ? This is my first time to join open source project. |
|
@siriak Could you take your spare time to give me some feedback ? I don't know what happened and what this project status is, imp2002 is not active for reviewing code. |
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.
Pull request overview
This PR adds a skip list data structure implementation to the algorithms repository. A skip list is a probabilistic data structure that provides O(log n) average time complexity for search, insertion, and deletion operations through multiple levels of linked lists with random balancing.
Key Changes
- Implements a generic
SkipList<K, V>data structure with insert, search, delete operations - Includes an iterator implementation for traversing the skip list in sorted order
- Adds comprehensive test coverage for core operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/data_structures/skip_list.rs | New skip list implementation with unsafe pointer-based node management and probabilistic level generation |
| src/data_structures/mod.rs | Exports the new SkipList struct to make it publicly available |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please address the comments where relevant and then I can merge the PR |
Thanks for your feedback, I'll do it later. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
siriak
left a comment
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.
Looks good, thanks!
Pull Request Template
Description
Add skip list.
Type of change
Please delete options that are not relevant.
Checklist:
cargo clippy --all -- -D warningsjust before my last commit and fixed any issue that was found.cargo fmtjust before my last commit.cargo testjust before my last commit and all tests passed.mod.rsfile within its own folder, and in any parent folder(s).DIRECTORY.mdwith the correct link.COUNTRIBUTING.mdand my code follows its guidelines.Please make sure that if there is a test that takes too long to run ( > 300ms), you
#[ignore]that ortry to optimize your code or make the test easier to run. We have this rule because we have hundreds of
tests to run; If each one of them took 300ms, we would have to wait for a long time.