A circular linked list implementation
Project description
circulartape
It's a node-oriented circular linked list implementation.
Example
from circulartape import Tape
one = Tape("one") # one.to_list() == ["one"]
two = one.insert("two") # one.to_list() == ["one", "two"]
three = two.insert("three") # one.to_list() == ["one", "two", "three"]
two.remove() # one.to_list() == ["one", "three"]
# You can build a long list and seek through it n nodes at a time:
one = Tape(1)
current = one
for i in range(2, 100):
current = current.insert(i)
one.seek(30).data # => 31
# Use negative values to seek backwards.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
circulartape-0.0.1.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for circulartape-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7761c57bdeb04c7db8a13a186a5cefd44e8207b6a7259f568796e51c0db36f2 |
|
MD5 | 85da360753b89f7a5d7683349860cf2e |
|
BLAKE2b-256 | f4560ec16d7a1475255564fc961c17dd6564d2f18123cdabd2bdbfa9b6f0a63b |