Skip to content

Instantly share code, notes, and snippets.

View simc's full-sized avatar

Simon Choi simc

View GitHub Profile
@simc
simc / indexable_skip_list.dart
Created August 2, 2023 09:53
Fast indexable skip list for Dart. All operations (except clear) are O(log n)
import 'dart:collection';
import 'dart:math';
class IndexableSkipList<K, V> {
static const _maxHeight = 12;
final _Node<K, V> _head = _Node(
null,
null,
List.filled(_maxHeight, null),