Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smv1999/py_dsa
The py_dsa package contains all the data structures and algorithms implementations
https://github.com/smv1999/py_dsa
algorithms data-structures dsa hacktoberfest pip programming pypi pypi-package python
Last synced: 2 months ago
JSON representation
The py_dsa package contains all the data structures and algorithms implementations
- Host: GitHub
- URL: https://github.com/smv1999/py_dsa
- Owner: smv1999
- License: mit
- Created: 2021-07-03T14:15:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-03T10:14:22.000Z (over 2 years ago)
- Last Synced: 2024-10-31T15:24:40.627Z (3 months ago)
- Topics: algorithms, data-structures, dsa, hacktoberfest, pip, programming, pypi, pypi-package, python
- Language: Python
- Homepage: https://pypi.org/project/py-dsa/
- Size: 17.6 KB
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## py-dsa
![GitHub followers](https://img.shields.io/github/followers/smv1999?style=for-the-badge)
![GitHub forks](https://img.shields.io/github/forks/smv1999/py_dsa?style=for-the-badge)
![GitHub Repo stars](https://img.shields.io/github/stars/smv1999/py_dsa?style=for-the-badge)
![Lines of code](https://img.shields.io/tokei/lines/github/smv1999/py_dsa?style=for-the-badge)
![GitHub](https://img.shields.io/github/license/smv1999/py_dsa?color=blue&style=for-the-badge)
![PyPI](https://img.shields.io/pypi/v/py_dsa?color=blue&style=for-the-badge)### Introduction
The py-dsa module contains all the data structures and algorithms implementations.
### Installation
You can install the module using pip as shown below.
```bash
pip install py-dsa
```
### UsageConsider the following examples :
```python
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
"""
``````python
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
"""
``````python
from py_dsa.algorithms import *a = [1, 2, 3, 4.5]
s = Searching()
print(s.linear_search(a, 3))
"""
Output :
2
"""
```
### TestingTo install py-dsa, along with the tools you need to develop and run tests. Run the following command :
```bash
$ pip install -e .[dev]
```For running the tests, type the following command :
```bash
py.test
```### Bugs/Requests
Please use the [GitHub issue tracker](https://github.com/smv1999/py_dsa/issues) to submit bugs or request features.
### License
Copyright Vaidhyanathan S M, 2021
Distributed under the terms of the [MIT](https://github.com/smv1999/py_dsa/blob/main/LICENSE) license, py-dsa is free and open source software.