https://github.com/gottwik/skippity
Python skiplist with fast median discovery
https://github.com/gottwik/skippity
python-skiplist
Last synced: 11 months ago
JSON representation
Python skiplist with fast median discovery
- Host: GitHub
- URL: https://github.com/gottwik/skippity
- Owner: Gottwik
- Created: 2016-10-29T12:20:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-29T12:20:38.000Z (over 9 years ago)
- Last Synced: 2025-06-24T07:08:12.073Z (12 months ago)
- Topics: python-skiplist
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Skippity
Python skiplist implementation with fast median discovery. Ideal for rolling median problems such as this: [Hackerrank median](https://www.hackerrank.com/challenges/median).
## Debug
comes with neat debug visualization
```
______ 2 ___________ 5 ______ 7 _
_ 1 _ 2 _ 3 ______ 5 ______ 7 _
_ 1 _ 2 _ 3 _ 4 _ 5 _ 6 _ 7 _
```
For median discovery, each node knows how much base nodes will going forward in the current layer skip
```
1 ______ 2 ___________ 1 ______ 0 _
0 _ 0 _ 0 _ 1 ______ 1 ______ 0 _
0 _ 0 _ 0 _ 0 _ 0 _ 0 _ 0 _ 0 _
```