第38954题 单选题
以下代码实现二叉树左子树优先的深度优先搜索算法,则横线上应填写( )。
void dfs(TreeNode *root) {
    if (root == nullptr)
        return;

    stack<TreeNode *> s;
    s.push(root);
    while (!s.empty()) {
        TreeNode *node = s.top();
        s.pop();
        cout << node->value << " ";

        ———————————————————————— // 在此处填入代码
    }
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析