Skip to content
/ tree Public

🌳 Simple binary tree implementation in PHP.

License

Notifications You must be signed in to change notification settings

anglesoft/tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌳 Tree

Simple binary tree implementation in PHP.

Installation

composer require angle/tree

Usage

Creating a tree:

use Angle\Tree\Leaf;

$tree = new Leaf(10);
$tree->insert(5);
$tree->insert(15);
$tree->insert(8);

Check for values within the tree:

$tree->contains(5); // true
$tree->contains(42); // false

Climb the tree:

$tree->left->right->data == 8; // true

Contributing

Improvements are welcome! Feel free to submit pull requests.

Licence

MIT

Copyright © 2019 Angle Software

About

🌳 Simple binary tree implementation in PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages