Skip to main content

Doubly linked list datastructure in Python

Project description

This code is a Python implementation of a doubly linked list. I needed it for a very narrow scope, so the functionality might not have what you’re looking for. If you’d like a feature added, please email AWNystrom@gmail.com

INSTALLATION To instal, run the following command: python setup.py install

TESTING To run unit tests, run the following command: python doubly_linked_list/test_doubly_linked_list.py

USAGE Here’s some example usage:

>>> from doubly_linked_list import DoublyLinkedList
>>> dll = DoublyLinkedList(range(10))
>>> print dll
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> dll.moveToHead(dll.tail)
>>> print dll
[9, 0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> dll.removeHead()
>>> print dll
[0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> from random import shuffle
>>> shuffle(dll)
>>> print dll
[1, 4, 0, 2, 6, 3, 5, 7, 8]
>>> dll.moveToHead(dll.getNodeByIndex(4))
>>> print dll
[6, 1, 4, 0, 2, 3, 5, 7, 8]

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

doubly_linked_list-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doubly_linked_list-1.0.0.macosx-10.5-x86_64.exe (65.1 kB view details)

Uploaded Source

File details

Details for the file doubly_linked_list-1.0.0.tar.gz.

File metadata

File hashes

Hashes for doubly_linked_list-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5c27dd9005268318bea7c76e1a3876e8f5e156253dee26d8a154f72dcec880f3
MD5 df9639cefdc787fd3d989e7f45fa266f
BLAKE2b-256 9ac2b51513908bbc02ed2cbe4aa3a7f5285293c6a87507a93532f411c3656d21

See more details on using hashes here.

File details

Details for the file doubly_linked_list-1.0.0.macosx-10.5-x86_64.exe.

File metadata

File hashes

Hashes for doubly_linked_list-1.0.0.macosx-10.5-x86_64.exe
Algorithm Hash digest
SHA256 35f1f5adaad77c668f79ef6b2d87ac656d7b9409e93373bbf55e762af9ae2ad3
MD5 4a725689ec0b9e37e0cf79a7e54b8b75
BLAKE2b-256 26431d3b2093d8b2686446e622b0d5953003504bca05ec83eb0fe0d394e18813

See more details on using hashes here.

Supported by

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