https://github.com/asarkar/pydata
Python Data Structures: Linked List, and Binary Tree
https://github.com/asarkar/pydata
binary-tree data-structures linked-list python
Last synced: 5 months ago
JSON representation
Python Data Structures: Linked List, and Binary Tree
- Host: GitHub
- URL: https://github.com/asarkar/pydata
- Owner: asarkar
- License: apache-2.0
- Created: 2024-12-19T03:45:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-09T01:12:19.000Z (about 1 year ago)
- Last Synced: 2025-04-05T15:09:41.732Z (12 months ago)
- Topics: binary-tree, data-structures, linked-list, python
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Data Structures
Python Package containing simple data structures used in data structure and algorithm questions
found on online platform such as LeetCode. This package can be used while working on such
questions locally.
Meant to be used in personal projects only, and makes absolutely no guarantees.
[](https://github.com/asarkar/pydata/actions)
## Development
```
pydata% $(brew --prefix python)/bin/python3 -m venv ./venv
pydata% ./venv/bin/python -m pip install --upgrade pip '.[test]' '.[lint]'
```
## Usage
* [ListNode](src/pydata/listnode.py)
```
nums = [1, 2, 3]
head = ListNode.from_iterable(nums)
assert head is not None and list(head) == nums
```
* [TreeNode](src/pydata/treenode.py)
```
nums = [1, 2, 3]
root = TreeNode.from_seq(nums)
assert root is not None and list(root) == nums
print(str(root))
1
/ \
2 3
```
## Running tests
```
./.github/run.sh
```
## License
Released under [Apache License v2.0](LICENSE).