private Node putRoot(Node x, Key key, Value value)
			throws DuplicateKeyException {
		if (x == null)
			return new Node(key, value, 1);
		int cmp = key.compareTo(x.key);
		if (cmp == 0)
			throw new DuplicateKeyException();
		else if (cmp < 0) {
			x.left = putRoot(x.left, key, value);
			x = rotateRight(x);
		} else if (cmp > 0) {
			x.right = putRoot(x.right, key, value);
			x = rotateLeft(x);
		}
		x.count = 1 + size(x.left) + size(x.right);
		return x;
	}