private int tongChan (Node t){ if(t == null ) return 0; else if((int) t.info %2==0) return (int) t.info + tongChan(t.left)+tongChan(t.right); else return tongChan(t.left)+tongChan(t.right); } public void tongChan(){ System.out.println(tongChan(r)); }
Không có nhận xét nào: