Esempio n. 1
0
 protected function order(NaryTree $root = NULL)
 {
     if ($root == NULL || $this->realRoot == $root) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->order($child);
     }
     $this->countChildren++;
 }
Esempio n. 2
0
 protected function order(NaryTree $root = NULL)
 {
     if ($root == NULL) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->order($child);
     }
     $this->finalData[] = $root->getData();
 }
Esempio n. 3
0
 private function postOrderDestruct(NaryTree $root = NULL)
 {
     if ($root == NULL) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->postOrderDestruct($child);
     }
     $root = NULL;
 }