第21028题 单选题
C++实现二叉树深度优先搜索(DFS)的代码空缺处应填入的正确选项是?
struct TreeNode {    int val;    TreeNode* left;    TreeNode* right;    TreeNode(int x): val(x), left(nullptr), right(nullptr) {}};
void dfs(TreeNode* root, vector<int>& result) {    if (root == nullptr) return;    _________}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析