Skip to main content

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


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)

Uploaded source

Built Distribution

circulartape-0.0.1-py3-none-any.whl (2.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page