#skip-list #tree #intrusive #list

no-std skippy

Highly flexible worst-case O(log n) intrusive skip list

2 unstable releases

0.1.0 Jun 14, 2025
0.0.0 Dec 17, 2022

#1288 in Data structures

Download history

59 downloads per month
Used in eips

AGPL-3.0-or-later

125KB
2.5K SLoC

Skippy

A highly flexible, non-amortized worst-case O(log n) intrusive skip list.

The skip list can be used both as a sorted sequence (allowing it to be used as a set or map) and as an unsorted sequence of elements in arbitrary order (allowing it to be used as a vector/dynamic array). Elements support an optional notion of “size”, allowing insertions, removals, and lookups by index, as well as, due to the intrusive nature of the skip list, the ability to query an element’s index.

Internal nodes in the skip list are allocated deterministically so that between any two consecutive nodes at layer L, there are always between F / 2 and F nodes at layer L - 1, where F is a configurable fanout parameter. This is very similar to a B+ tree; in fact, this skip list is essentially a B+ tree where children are stored in linked lists rather than arrays.

Crate features

If the crate feature allocator_api is enabled, the skip list can be configured with the unstable Allocator trait. Otherwise, allocator-fallback will be used.

This crate can be used in no_std contexts by disabling the std feature.

Dependencies

~98KB