LeastCommonAncestors

所属分类:数据结构
开发工具:Visual C++
文件大小:1KB
下载次数:6
上传日期:2013-07-03 08:29:57
上 传 者ahhfzrx
说明:  求一棵二叉树的2个结点的最近公共祖先 输入:根据带空指针的先序遍历结果建立普通二叉树 数据元素类型:字符类型 空指针: # 输入格式: 第一行:依次为元素个数N 第二行:元素序列 第三行:字符x 字符y 输出格式:x与y的最近共同祖先的元素值,或者NULL。 注意:1、输入错误时,输出ERROR(大写)并结束程序。2、树节点保存的元素值为字符类型。3、任意多余输出视为错误。4、二叉树的结点关键字是主关键字
(Seeking a binary tree of two recent common ancestor node input: with a null pointer under preorder traversal results establish ordinary binary data element types: character type null pointer:# Input format: The first line: the order of the number of elements N Second row: the third line of the sequence of elements: Character x Character y output format: x and y of the most recent common ancestor of the element value, or NULL. Note: 1, input error, the output ERROR (uppercase) and end the program. 2, the elements of the tree node holds the value character type. 3, any excess output as an error. 4, the binary tree node keyword is the primary key)

文件列表:
寻找最近公共祖先.c (2908, 2013-05-21)

近期下载者

相关文件


收藏者