public boolean isBalanced(treeNode root,
			HashMap<treeNode, Integer> nodeDepthes) {
		if (root == null)
			return true;
		int depthLeft = depthOfNode(root.leftLeaf, nodeDepthes);
		int depthRight = depthOfNode(root.rightLeaf, nodeDepthes);

		if (!isBalanced(root.leftLeaf, nodeDepthes))
			return false;

		if (!isBalanced(root.rightLeaf, nodeDepthes))
			return false;

		if (depthLeft + 1 <= depthRight || depthLeft - 1 >= depthRight)
			return true;
		else
			return false;
	}