Binarytree

Latest version: v6.5.1

Safety actively analyzes 628969 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 3

3.0.0

* Full documentation is now [here](http://http://binarytree.readthedocs.io)!
* Complete overhaul (with non-backward compatible API changes):

* Many new methods added to [binarytree.Node](http://binarytree.readthedocs.io/en/master/api.html#class-binarytree-node) class.
* Replaced `binarytree.convert` method with [binarytree.build](http://binarytree.readthedocs.io/en/latest/api.html#function-binarytree-build) and [builtin iter method](http://binarytree.readthedocs.io/en/latest/api.html#binarytree.Node.__iter__)
* Renamed `binarytree.Node.show` to `binarytree.Node.pprint`
* Removed functions such as `binarytree.subtree`, `binarytree.prune` and `binarytree.leafs`. Now all introspection & management of trees and nodes are done through methods provided by [binarytree.Node](http://binarytree.readthedocs.io/en/master/api.html#class-binarytree-node).
* Removed `customize` method as it was unnecessarily complicating things. If you want to use your own custom node, you can always subclass [binarytree.Node](http://binarytree.readthedocs.io/en/master/api.html#class-binarytree-node).
* Added binarytree specific [exceptions](https://github.com/joowani/binarytree/blob/master/binarytree/exceptions.py).
* Some new features include level-order based indexing and traversals (inorder, preorder, postorder). Again, check them out in the new documentation!
* Add perfect [heap](http://binarytree.readthedocs.io/en/master/api.html#function-binarytree-heap) and [BST](http://binarytree.readthedocs.io/en/latest/api.html#function-binarytree-bst) generation via new `is_perfect` boolean parameter.

2.0.1

* Fixed a bug in binary search tree check.
* Made a minor optimization in balanced tree check.

2.0.0

* Renamed parameter `balanced` to `is_balanced` for function `binarytree.tree`.
* Renamed parameter `max` to `is_max` for function `binarytree.heap`.
* Renamed function `binarytree.pprint` to `binarytree.show`.
* Ranamed function `binarytree.setup` to `binarytree.customize`.
* Added new utility functions using level-order node IDs: `binarytree.show_ids`, `binarytree.show_all`, `binarytree.subtree`, `binarytree.prune` (view the [README](https://github.com/joowani/binarytree) for more details and examples).
* Added new utility function for getting leaf nodes: `binarytree.leafs`.
* Removed the ability to pretty print the tree directly using the python `print` keyword (e.g. `print(mytree)`). New ways to print them are `mytree.show()` or `show(mytree)`.

1.1.1

- Improved the documentation for `_build_str` function.
- Refactored the `_build_str` function to improve clarity for the readers.

1.1

Binary trees in a tree structure (as opposed to a list represenation) using `binarytree.Node` can now be displayed using Python's builtin `print` command, and has new methods `inspect` and `to_list`, which are equivalent to external functions `inspect` and `convert` respectively:

python

from binarytree import tree

my_tree = tree()
my_tree.to_list()
my_tree.inspect()
print(my_tree) No need to use pprint


Docstrings and documentation are also updated.

1.0

Initial release

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.