A circular linked list implementation
Project description
circulartape
It's a node-oriented circular linked list implementation.
Source: phab.tris.fyi.
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.3.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for circulartape-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ebfacc8fdc537edea9c5908dfbb9498623dd27cdf1f8d7c268f9b68dadc427e |
|
MD5 | d92d83d4f578147684c7400aa7b51201 |
|
BLAKE2b-256 | d3e1ebf860d54304681527128d7b299d642ff23e58608fd0540e7a4ac8dac78e |