private int getShape(STNode<Key, Value> x)
	{
		/*
		 * Balance factor of a node is the difference between the height of its
		 * left subtree and right subtree in that order.
		 */
		switch (height(x.left) - height(x.right))
		{
		case 2:
			switch (height(x.left.left) - height(x.left.right))
			{
			case 0: // can return LLEFT or LRIGHT
			case 1:
				return LLEFT;
			case -1:
				return LRIGHT;
			}
			break;
		case -2:
			switch (height(x.right.left) - height(x.right.right))
			{
			case 0: // can return LLEFT or LRIGHT
			case 1:
				return RLEFT;
			case -1:
				return RRIGHT;
			}
			break;
		}
		return BALANCED;
	}