A package that contains common data structures
Project description
Python Data Structures
For all of your data structure needs
About
A Python package that contains common data structures. Data structures within this package also contain associated search and sorting algorithms. The intention of this package is mostly a learning endeavor but, it may also be used for various build purposes. I hope you find it easy to understand and interact with. If you have any questions or comments, please feel free to reach out.
Getting Started
Installation
To get started, install the package:
user@machine:~/$ pip install pydatastructs
Then, import it into your project:
from pydatastructs import Stack, Queue, Tree, BinarySearchTree, LinkedList
my_stack = Stack(collection=[1, '2', {'3': 3}])
my_queue = Queue(collection=[4.4, [5], (6)])
my_tree = Tree(value='I am Groot')
my_binarysearchtree = BinarySearchTree(value=10)
my_linkedlist = LinkedList(value='HEAD')
Data Structures
Stack
A list or array based data structure with last-in-first-out (LIFO) properties.
Methods
- get()
- length()
- is_empty()
- push()
- pop()
- merge_sort()
Queue
A list or array based data structure with first-in-first-out (FIFO) properties.
Methods
- get()
- length()
- is_empty()
- enqueue()
- dequeue()
- merge_sort()
Tree
A node based data structure where each node contains a value property and a children property. The children property is a collection of child nodes. Finally, each node itself is a tree or sub-tree.
Methods
- add()
- contains()
- depth_first_traversal()
- breadth_first_traversal()
Binary Search Tree
A node based data structure where each node contains a value property and, a left and right property. The left and right properties point to potential child nodes. The left node's value will always be less than the parent node's value. The right node's value will always be greater than the parent node's value. Finally, each node itself is a tree or sub-tree.
Methods
- insert()
- contains()
- depth_first_traversal()
- breadth_first_traversal()
Linked List
A node based data structure containing a head and tail property. The head points to the root node and, the tail points to the last node in the linked list. Each node has a value property and a next property, which points to the next node in the linked list.
Methods
- append()
- remove_head()
- find_node()
Contact
For support, feedback or, to report a bug, you may contact the maintainer:
License
Distributed under the MIT License.
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
Built Distribution
File details
Details for the file pydatastructs-1.2.1.tar.gz
.
File metadata
- Download URL: pydatastructs-1.2.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5669ebf57c1b169d48239baa8711458c11fe4933c868f6de6f7fc834192fc5bc |
|
MD5 | 284cb35a9771c6976beb265e099dd79a |
|
BLAKE2b-256 | ca2561ee2097f25b165572a6fbeb45568b1026076ba389801c6e1842405fe66f |
File details
Details for the file pydatastructs-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: pydatastructs-1.2.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2aeaacadaffdc2df5dfe8e28e450111d638b2932d4ad0396e3f7ff7d6b10500 |
|
MD5 | d485926feee08c68e073730d8d9f2899 |
|
BLAKE2b-256 | fb8c208c98dd99699411c4c6408ebc9c92657c77b704c47b5734e9f17a3be390 |