Skip to content

Conversation

@zhangzhuang15
Copy link
Contributor

Pull Request Template

Description

Add skip list.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

Please make sure that if there is a test that takes too long to run ( > 300ms), you #[ignore] that or
try 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.

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 98.64253% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.43%. Comparing base (21f5615) to head (c310c08).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/data_structures/skip_list.rs 98.64% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhangzhuang15
Copy link
Contributor Author

@imp2002 Hey, could you give me some feedback ? This is my first time to join open source project.

@zhangzhuang15
Copy link
Contributor Author

@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.

Copy link

Copilot AI left a 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.

@siriak
Copy link
Member

siriak commented Dec 4, 2025

Please address the comments where relevant and then I can merge the PR

@zhangzhuang15
Copy link
Contributor Author

Please address the comments where relevant and then I can merge the PR

Thanks for your feedback, I'll do it later.

zhangzhuang15 and others added 2 commits December 5, 2025 10:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zhangzhuang15
Copy link
Contributor Author

@siriak Comments are resolved. It's really a nice experience for me to give PR for this project. By the way, I also have another PR #952, which fixes a bug in rb_tree.rs file, would you mind taking a look at it ? Thank you.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 700fd3a into TheAlgorithms:master Dec 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants