Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

doubly-py-linked-list

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doubly-py-linked-list

Doubly linked list implementation in Python

  • 1.1.1
  • PyPI
  • Socket score

Maintainers
1

Doubly (Py) Linked List 1️⃣ ↔️ 2️⃣ ↔️ 3️⃣

CI License

A module that implements doubly linked lists in python

Example

python -m pip install doubly-py-linked-list
>>> from doubly_py_linked_list import DoublyLinkedList as dll
>>> d = dll([1, 2, 3, 4])
>>> d
1 <-> 2 <-> 3 <-> 4
>>> node_0 = d.insert_head(0)
>>> node_5 = d.insert_tail(5)
>>> for v in d:
...     print(v)
...
0
1
2
3
4
5
>>> d.move_to_head(node_5)
>>> d.move_to_tail(node_0)
>>> list(d)
[5, 1, 2, 3, 4, 0]
>>> d.pop_head()
5
>>> list(d)
[1, 2, 3, 4, 5, 0]
>>> d.pop_tail()
0
>>> list(d)
[1, 2, 3, 4]
>>> d.nodes(d)
[ddl_node(1), ddl_node(2), ddl_node(3), ddl_node(4)]

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc