The py_dsa package 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.3.tar.gz
.
File metadata
- Download URL: py_dsa-0.0.3.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 | 6aea912f4425132186a91b540a298a648181835e07e7c28577a5805ccae412ce |
|
MD5 | 93a1b04925356eaec13fefffb4b302db |
|
BLAKE2b-256 | 841e3cd20b02ad200a26d8752aeeb228fdfc53357962e674768c2da78e0c6527 |
File details
Details for the file py_dsa-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: py_dsa-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.5 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 | 61eff31f769912da4b4919f7c0d0d154db02f4499c53f57d0d59d97bb8e82120 |
|
MD5 | e3657231c1a250103e60e6466a9b525d |
|
BLAKE2b-256 | ea5871d86090806784fac75eb74a22aac2374e53cb22cc9b616fb49a00ddcc4f |