想让下面这份栈版深度优先遍历「左孩子先于右孩子被访问」,横线处应填入( )。
TreeNode* node = st.top(); st.pop();
cout << node->val << " ";
____________
- A.
if (node->left) st.push(node->left); - B.
if (node->right) st.push(node->right); - C.
if (node->left) st.push(node->right); - D.
st.push(node->left); st.push(node->right);