日期:2014-05-20 浏览次数:20708 次
public int sum(TreeNode a){ int k = 0; if(a == null){ return 0; }else if(a.getChildCount() == 0){ return 1; } else{ for(int i = 0;i<a.getChildCount();i++){ k = k + sum(a.getChildAt(i)); } return k; } }