Node LCA(Node root, Node p, Node q) {
		if (root == null) { // reached the bottom, not found
			return null;
		}
		if (root == p || root == q) { // found one, here compare with == if same
										// object, otherwise consider compare
										// key.
			return root;
		}

		Node l = LCA(root.left, p, q);
		Node r = LCA(root.right, p, q);

		if (l != null && r != null) {// on each side.
			return root;
		}

		return r != null ? r : l;
	}