Skip to main content

C-implemented linked-list module for Python

Project description

cllist is an extension module for CPython providing basic linked list data structures.

Collections implemented in the llist module perform well in problems which rely on fast insertions, pops, and removal of elements in the middle of a sequence.

For this kind of workload, they can be significantly faster than collections.deque or standard Python lists.

This project was forked from https://github.com/ajakubek/python-llist

and adds many features and enhancements to the original, under a new name “cllist”.

The cllist version now lives at https://github.com/kata198/python-cllist

If you were using the previous module, you can change to this new module, it is completely backwards (but not forwards) compatible.

Single Linked List

Singly linked lists are provided by the “sllist” module. This is your basic single-linked list, and might be useful for some scenarios.

A single linked list is far less efficient at everything than the double-linked list implementation.

Double Linked List

A double-linked list is provided by the “dllist” module.

This provides great performance when doing pops and insertions at random (in the middle), or at either end.

This implementation has been enhanced by implementing a “middle” marker.

This “middle” marker is used when the list size exceeds 10 elements, and is used in all operations which involve walking the list,

which ensures that AT MOST N/4 elements will need to be walked (so the shortest distance from either start, middle, or end is calculated, and walked from there).

This additional feature makes this linked list much more efficient on larger data sets than a standard double-linked list implementation.

Why use a linked list?

A linked list should be used when you are going to be adding or removing elements in the middle of the dataset. A standard python list forces the entire list to be reallocated and copied when such happens, whereas this can do so without reallocating.

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

cllist-1.0.2.tar.gz (45.4 kB view details)

Uploaded Source

Built Distributions

cllist-1.0.2-py3.6-linux-x86_64.egg (80.0 kB view details)

Uploaded Source

cllist-1.0.2-py3.5-linux-x86_64.egg (79.6 kB view details)

Uploaded Source

cllist-1.0.2-py2.7-linux-x86_64.egg (25.6 kB view details)

Uploaded Source

File details

Details for the file cllist-1.0.2.tar.gz.

File metadata

  • Download URL: cllist-1.0.2.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cllist-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f90e53038644eda1b17c4b91aea0431d3de9a60e07a3a74b4d499ce14462e800
MD5 dab728bd59a0b6bb92c8023ced03a8e0
BLAKE2b-256 8d244624ea75d012cf825fb2a112727c45be6ce5bbd586996dc245c79fdaaf7d

See more details on using hashes here.

File details

Details for the file cllist-1.0.2-py3.6-linux-x86_64.egg.

File metadata

File hashes

Hashes for cllist-1.0.2-py3.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 1dfb0e1fd55a9a4ba10d73eaeaf6191524f27810b9926c5e616cee438f2e4e7a
MD5 fcf2fafd86b3b5f2a864fd39db8fd87e
BLAKE2b-256 5fdb29c7ce9f949889fbadbc3ebc923feb7dd1f6cbdcfa3f882c0bb58c94b4ca

See more details on using hashes here.

File details

Details for the file cllist-1.0.2-py3.5-linux-x86_64.egg.

File metadata

File hashes

Hashes for cllist-1.0.2-py3.5-linux-x86_64.egg
Algorithm Hash digest
SHA256 9dd9aa6be7a68639e1c88e05fd54e60bf62c5d8b624c92a840cf46be95e09319
MD5 a7dead22e2a4791f3f4f8ad326c3cbfc
BLAKE2b-256 1d2637848b2c5be1c2c4b665b45da4341cf2ac61093f3ae6eb817eebdd7541a2

See more details on using hashes here.

File details

Details for the file cllist-1.0.2-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for cllist-1.0.2-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 e66c3fbbd16f36b4366336a02044c4b1efcb108b0b3eb72bd4e47a355e48a038
MD5 fc5d2dfa26db6267776d7507daf62628
BLAKE2b-256 4ae9007575b62a1c96cb77bb458ef83dec9e0a0238184693dea00f60d7b2a18b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page