Metadata-Version: 2.4
Name: binarytrees-nv
Version: 0.1.3
Summary: Package providing recursive and iterative binary tree generators.
Author: Anton Sibilev
Author-email: Anton Sibilev <antonsibilev0025@gmail.com>
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/AntSib/Python-Herzen-Course/tree/main/%D0%A1%D0%B5%D0%BC%D0%B5%D1%81%D1%82%D1%80-5/LR-3
Description-Content-Type: text/markdown

This is a package providing recursive and iterative binary tree generators. Each nodes' values are generated using provided functions. (By default, the leaf values are equal to the root value.)
Don't take it too seriously. It is a demo package, but still can be used as a library.

# Installation
```bash
pip install binarytrees_nv
```

## Usage
```python
from binarytrees_nv import gen_bin_tree_iterative, gen_bin_tree_recursive

height: int = 4

# recursive
recursive_tree = gen_bin_tree_recursive(height)
# or iterative
iterative_tree = gen_bin_tree_iterative(height)

print(recursive_tree)
print(iterative_tree)


# Custom functions for leaf values
def left_function(x):
    return x ** 2

def right_function(x):
    return x - 2

custom_tree = gen_bin_tree_iterative(height, left_function=left_function, right_function=right_function)

print(custom_tree)
```
