文件名称:homework
介绍说明--下载内容均来自于网络,请自行研究使用
已知一棵排序二叉树,树中结点的形式为:
data info left right
其中,data 给出结点的数据场,info 给出本结点的左子树中的结点总数,left和 right 分别给出本结点的左儿子和右儿子的地址。数据场data 和info的类型皆为 int。又已知该二叉排序树的根结点的地址为 root。请设计二个函数,分别实现下述功能:
1. 按递增序找出该二叉排序树中的第 i 个小的结点。
2. 插入数据场之值为 x 的结点,并仍应保持该二叉排序树的性质不
变。
-Known a sort tree, the tree nodes in the form: data info left right one, data given node data field, info given in the left sub-tree nodes in the total number of nodes, left and nodes are given the right the left and right son of the son' s address. Data field data and the type of info are all int. It is known that the binary sort tree root node' s address root. Please design two functions, namely to achieve the following functions: 1. By increasing order to find the binary sort tree nodes i-small. 2. Insert data field of the value of x nodes, and should maintain the binary sort tree, the nature of the change.
data info left right
其中,data 给出结点的数据场,info 给出本结点的左子树中的结点总数,left和 right 分别给出本结点的左儿子和右儿子的地址。数据场data 和info的类型皆为 int。又已知该二叉排序树的根结点的地址为 root。请设计二个函数,分别实现下述功能:
1. 按递增序找出该二叉排序树中的第 i 个小的结点。
2. 插入数据场之值为 x 的结点,并仍应保持该二叉排序树的性质不
变。
-Known a sort tree, the tree nodes in the form: data info left right one, data given node data field, info given in the left sub-tree nodes in the total number of nodes, left and nodes are given the right the left and right son of the son' s address. Data field data and the type of info are all int. It is known that the binary sort tree root node' s address root. Please design two functions, namely to achieve the following functions: 1. By increasing order to find the binary sort tree nodes i-small. 2. Insert data field of the value of x nodes, and should maintain the binary sort tree, the nature of the change.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
作业3.cpp