PHP code example of angle / tree
1. Go to this page and download the library: Download angle/tree library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
angle / tree example snippets
use Angle\Tree\Leaf;
$tree = new Leaf(10);
$tree->insert(5);
$tree->insert(15);
$tree->insert(8);
$tree->contains(5); // true
$tree->contains(42); // false
$tree->left->right->data == 8; // true