The py_dsa module contains all the data structures and algorithms implementations
Project description
py-dsa
Introduction
The py-dsa module contains all the data structures and algorithms implementations.
Installation
You can install the module using pip as shown below.
pip install py-dsa
Usage
Consider the following examples :
from py_dsa.data_structures import *
test_linkedlist = LinkedList()
test_linkedlist.add_first(10)
test_linkedlist.add_first(20)
test_linkedlist.add_first(30)
test_linkedlist.remove_last()
test_linkedlist.reverse_list()
test_linkedlist.print_list()
"""
Output :
20
30
"""
from py_dsa.data_structures import *
test_tree = Tree()
test_tree.add(10)
test_tree.add(5)
test_tree.add(30)
print(test_tree.height())
test_tree.invert_tree()
test_tree.print_tree(traversal='postorder')
"""
Output:
2
30
5
10
"""
from py_dsa.algorithms import *
a = [1, 2, 3, 4.5]
s = Searching()
print(s.linear_search(a, 3))
"""
Output :
2
"""
Testing
To install py-dsa, along with the tools you need to develop and run tests. Run the following command :
$ pip install -e .[dev]
For running the tests, type the following command :
py.test
Bugs/Requests
Please use the GitHub issue tracker to submit bugs or request features.
License
Copyright Vaidhyanathan S M, 2021
Distributed under the terms of the MIT license, py-dsa is free and open source software.
Project details
Release history Release notifications | RSS feed
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 py_dsa-0.0.2.tar.gz
.
File metadata
- Download URL: py_dsa-0.0.2.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49786eab8223508fa744e4466324663c49005d3b53b4d5cb10fe37f3ef335443 |
|
MD5 | 7a20bb0d48f05a3b949a5189c5cbdfad |
|
BLAKE2b-256 | eac4c2179aed60f3b9c216d43673988ddaa64991d934c3c0253e2f97e78c779e |
File details
Details for the file py_dsa-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: py_dsa-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f33b3737870ae4e1d2b6dbc2f2a56e35c6fb39e3e1ed4dd899f3e392710ca5a |
|
MD5 | 4285e9ca78509f1e368f1325d0bca69d |
|
BLAKE2b-256 | e2adc6d059a453dd812720c1792de6716fa008e2d9f9e146397fe144d3b62111 |