java实现树的节点之间距离;向下递归,注意找到一个满足条件的节点要break
package com.zhangle.arithmetic;import java.util.ArrayList;import java.util.List;public class NodeofTreeDistance {static class Tree {private List list = new ArrayList();/*** 内