예제 #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
파일: NaryTree.php 프로젝트: rendix2/QW_MVS
 private function postOrderDestruct(NaryTree $root = NULL)
 {
     if ($root == NULL) {
         return;
     }
     foreach ($root->getChildren() as $child) {
         $this->postOrderDestruct($child);
     }
     $root = NULL;
 }