Which XXX should replace the missing statement in the following BSTReplaceChild algorithm? BSTReplaceChild(parent, currentChild, newChild) { if (parent⇢left != currentChild && parent⇢right != currentChild) return false if (parent⇢left == currentChild) parent⇢left = newChild else parent⇢right = newChild XXX newChild⇢parent = parent return true } 单项选择题
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
How many children can a node have in a binary tree?
Type of Binary Trees A binary tree is full if every node contains 0 or 2 children. A binary tree is complete: If all levels, except possibly the last level, contain all possible nodes and all nodes in the last level are as far left as possible. A binary tree is perfect if all internal nodes have 2 children and all leaf nodes are at the same level. Which of the following are complete and full, but NOT perfect binary trees?
A perfect binary tree has leaves at least a half of the total number of nodes.
How many nodes in a perfect binary tree if the tree has 4 levels?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!