示例#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++;
 }
示例#2
0
 protected function order(NaryTree $root = NULL)
 {
     if ($root == NULL) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->order($child);
     }
     $this->finalData[] = $root->getData();
 }
示例#3
0
 private function postOrderDestruct(NaryTree $root = NULL)
 {
     if ($root == NULL) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->postOrderDestruct($child);
     }
     $root = NULL;
 }