Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/furiosojack/mrbinarytree
Arbol binario para ordenamiento o busqueda | Binary tree to sort or search
https://github.com/furiosojack/mrbinarytree
sort sorting-algorithms tree tree-structure
Last synced: 16 days ago
JSON representation
Arbol binario para ordenamiento o busqueda | Binary tree to sort or search
- Host: GitHub
- URL: https://github.com/furiosojack/mrbinarytree
- Owner: FuriosoJack
- License: mit
- Created: 2017-12-11T17:24:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-10T22:22:12.000Z (about 6 years ago)
- Last Synced: 2024-11-18T09:39:02.784Z (about 1 month ago)
- Topics: sort, sorting-algorithms, tree, tree-structure
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MrBinaryTree
Arbol binario para ordenamiento o busqueda de cualquier tipo de dato que sea comparable con > y < | Binary tree to sort or search# License
El codigo de licencia debe seguirse al pie de la letra, si usted utiliza esta libreria los derechos de autor deben estar incluidos en todas la copias.
Para mas informacion la puede encontra en el archivo LICENSE.txt.
## Installation```bash
$ composer require furiosojack/mr-binary-tree
```OR
add to your `composer.json`
```json
{
"require": {
"furiosojack/mr-binary-tree": "^0.2"
}
}
```## Examples
```php
$ips = [
'255.168.0.1',
'172.6.0.1',
'172.0.0.1',
'201.0.0.0'
];
$i=0;
$tree = new MrBinaryTree();
foreach ($ips as $address){
$keyAdress = $i;
$tree->addNode($keyAdress, $address);
$i++;
}
$tree->inAsc($tree->getRoot());
//Deprecated
echo $tree->getLisOrderedList();var_dump($tree->getNodesOrdered());
```result
```json
array:4 [▼
0 => "201.0.0.0"
1 => "172.0.0.1"
2 => "172.6.0.1"
3 => "255.168.0.1"
]
```