https://github.com/pashaproton/binary-tree
Example of the binary tree in different languages
https://github.com/pashaproton/binary-tree
algorithms binary-tree c cpp education example javascript php python
Last synced: 6 days ago
JSON representation
Example of the binary tree in different languages
- Host: GitHub
- URL: https://github.com/pashaproton/binary-tree
- Owner: pashaproton
- Created: 2023-09-11T04:01:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-12T06:12:42.000Z (over 2 years ago)
- Last Synced: 2023-12-16T15:56:08.629Z (over 2 years ago)
- Topics: algorithms, binary-tree, c, cpp, education, example, javascript, php, python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Binary Tree
There are examples in different languages of binary tree implementation.
[C](./examples/C/binary-tree.c)
| [C++](./examples/C++/binary-tree.cpp)
| [PHP](./examples/PHP/binary-tree.php)
| [Python](./examples/Python/binary-tree.py)
| [JavaScript](./examples/JavaScript/binary-tree.js)
---
Each implementation contains next functions or methods depends on language paradigm:
- **Depth first values** - explore the nodes of the tree, starting from a root node, and it returns a list of node values in the order they were visited.
- **Breath first Values** - visiting all root immediate children before moving on to their children, and so on.
- **Tree Includes** - checks whether a given value exists within a binary tree.
- **Tree Sum** - The "Tree Sum" function calculates the sum of all the values stored in the nodes of a binary tree.
- **Tree Min Value** - finds the minimum value.
- **Max Root to Leaf Path Sum** - calculates the maximum sum that can be obtained by following a path from the root node to any leaf node in a binary tree.
---
### Examples
Each example has **run.sh** file which can be run by `sh run.sh` command. Files structure and names are the same for every language, difference in implementation only.
### Contributing and Issues
- If you see a bug in the code please add new issue [bugs](https://github.com/pashaproton/binary-tree/issues/new) with label **bug**.
- Do not hesisate [add new ideas](https://github.com/pashaproton/binary-tree/issues/new) with label **proposal**.
- Feel free fork the project or add new ideas.