All pastes #406092 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-03-22 03:41 UTC
rendered paste body
	public int getTreeHeight() {		if(root != null) {			return 1+Math.max(getTreeHeight(root.right),getTreeHeight(root.left));		} else {			return 0;		}	}		private int getTreeHeight(Node currentNode) {		if(currentNode == null) {			return 0;		} else {			return 1+Math.max(getTreeHeight(currentNode.left),getTreeHeight(currentNode.right));		}	}