在一个二叉搜索树中插入10个元素C++数据结构原题:the ten keys Q.W.E.R.T.Y.U.I.O.P should be inserted one by one into a binary search tree.(the tree is initially empty.)(主要是看不明白.字母还可以比大小嘛.draw the b

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 07:13:27
在一个二叉搜索树中插入10个元素C++数据结构原题:the ten keys Q.W.E.R.T.Y.U.I.O.P should be inserted one by one into a binary search tree.(the tree is initially empty.)(主要是看不明白.字母还可以比大小嘛.draw the b

在一个二叉搜索树中插入10个元素C++数据结构原题:the ten keys Q.W.E.R.T.Y.U.I.O.P should be inserted one by one into a binary search tree.(the tree is initially empty.)(主要是看不明白.字母还可以比大小嘛.draw the b
在一个二叉搜索树中插入10个元素C++数据结构
原题:
the ten keys Q.W.E.R.T.Y.U.I.O.P should be inserted one by one into a binary search tree.(the tree is initially empty.)(主要是看不明白.字母还可以比大小嘛.
draw the binary search tree after each insertion.(只要能给我最后的二叉搜索树的结果就好)
what is the height of the final tree.(求下树高.)
construct a binary search tree with the smae ten keys that is lower than the tree just obtained..


谢过

在一个二叉搜索树中插入10个元素C++数据结构原题:the ten keys Q.W.E.R.T.Y.U.I.O.P should be inserted one by one into a binary search tree.(the tree is initially empty.)(主要是看不明白.字母还可以比大小嘛.draw the b
字母的比较大小就是按照字母表的顺序来的,A最小Z最大.这个题可以采用递归算法,思路如下:先跟根节点比较(树空第一个插入的节点是树根),比根节点小,插入到左子树;比根节点大,插入到右子树,一次插入,每次只能插入在叶子节点.这个是数据结构的问题,找本教材都会有伪代码.