Scan tree structure from bottom up?

前端 未结 3 762
广开言路
广开言路 2021-02-08 10:23

If given the following tree structure or one similar to it:

\"enter

I would want t

3条回答
  •  生来不讨喜
    2021-02-08 10:54

    something like this should do it

    public void traverse(){
        for(Child child : this.children){
            child.traverse();
        }
        System.out.print(this.value);
    }
    

提交回复
热议问题