public static TreeNode<?> findFirstCommonAncestor(TreeNode<?> root,
			TreeNode<?> node1, TreeNode<?> node2) {

		if (root == null || node1 == null || node2 == null) {
			return null;
		}

		Result result = findFirstCommonAncestorHelper(root, node1, node2);

		/*
		 * if one node belongs to the tree, the other doesn't, result.node is
		 * not null
		 */
		return (result.isAncestor) ? result.node : null;
	}