public boolean isBalanced(BTnode root)
	{
		int lh,rh;
		boolean l,r;
		
		if(root == null)
			return true;
		
		l = isBalanced(root.left);
		r = isBalanced(root.right);
		
		lh = (root.left != null) ? root.left.height : 0;
		rh = (root.right != null) ? root.right.height : 0;
		
		root.height = (lh > rh) ? lh :rh; 
		return ((Math.abs(lh-rh) <= 1) && l && r);
		
	}