1. Go to this page and download the library: Download crimson-nynja/php-trees 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/ */
crimson-nynja / php-trees example snippets
use PhpTrees\BinarySearchTree;
$b = new BinarySearchTree(rootValue: 5);
// This will create a binary search tree with a root of the value 5
use PhpTrees\Rope;
$r = new Rope(string: "This is a Rope!");
// This will create a Rope with the initial string, "This is a Rope!"
use PhpTrees\BinaryHeap;
$h = new BinaryHeap();
// This will create an empty binary heap
use PhpTrees\GenericTree;
$g = new GenericTree(rootValue: 4.1);
// This will create a generic tree with root 4.1
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.