Skip to content

paprykasz/dfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example PHP DFS algorithm implementation

Usage

<?php
 
 require 'vendor/autoload.php';

 use Webloft\Search\Dfs\DepthFirstSearch;
 use Webloft\Search\Dfs\Node;

 $rootNode = new Node('1');
 $rootNode->linkNode($node2 = new Node('2'));
 $rootNode->linkNode($node3 = new Node('3'));

 $node2->linkNode($node4 = new Node('4'));
 $node3->linkNode($node5 = new Node('5'));

 $dfs = new DepthFirstSearch();
 $availablePaths = $dfs->getAvailablePaths($rootNode);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages