第26881题 单选题
给定输入数组[5,3,7,2,4,6,8]构建二叉搜索树,结合给出的遍历代码求遍历输出结果

对上题中的二叉搜索树,当输入数组为 [5,3,7,2,4,6,8] 时,构建二叉搜索树,并采用如下代码实现的遍历方式,得到的输出是( )。

def traversal(tree_node* root) :
    if (root == nullptr) {
        return
    }
    traversal(root->left)
print(root->val)
print(" ")
traversal(root->right)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析