Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public function createTree($visitedArray) {
  2. foreach($this->pointList as $point) {
  3. $newVisitedArray = $visitedArray;
  4. //echo "New array";
  5. array_push($newVisitedArray,$point);
  6. //echo "Array push";
  7. if(in_array($point,$visitedArray)) {
  8. //echo "Same point";
  9. } else if($point == $this->endPoint) {
  10. $this->addPath($newVisitedArray);
  11. //echo "Completed path";
  12. $this->printPath($newVisitedArray);
  13. } else {
  14. $this->createTree($newVisitedArray);
  15. //blu
  16. echo "Create a new tree";
  17. }
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement