All pastes #2131141 Raw Edit

Anonymous

public text v1 · immutable
#2131141 ·published 2012-03-22 16:41 UTC
rendered paste body
  public boolean isLeaf(Node node)
  {
	  if(node.getLeft() == null && node.getRight() == null)
		  return true;
	  return false;
		   
  }
  public long sumTree(Node root)
  {
	 if(root == null)
		 return 0;
	 return root.getValue() + sumTree(root.getLeft()) + sumTree(root.getRight());
  }