Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function createTree($visitedArray) {
- foreach($this->pointList as $point) {
- $newVisitedArray = $visitedArray;
- //echo "New array";
- array_push($newVisitedArray,$point);
- //echo "Array push";
- if(in_array($point,$visitedArray)) {
- //echo "Same point";
- } else if($point == $this->endPoint) {
- $this->addPath($newVisitedArray);
- //echo "Completed path";
- $this->printPath($newVisitedArray);
- } else {
- $this->createTree($newVisitedArray);
- //blu
- echo "Create a new tree";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement