题目
题目
单项选择题

TTrave_Alg_3 Which one of the pseudocode given below is written for post-order traversal of a Binary Search Tree?

选项
A.BSTPrintInorder(node) {   if (node is null)       return                       BSTPrintInorder(node->left)                        BSTPrintInorder(node->right)  }
B.BSTPrintInorder(node) {   if (node is null)       return                       BSTPrintInorder(node->left)     BSTPrintInorder(node->right)   Print node                       }
C.BSTPrintInorder(node) {   if (node is null)       return                       Print node                         BSTPrintInorder(node->left)     BSTPrintInorder(node->right) }
D.BSTPrintInorder(node) {   if (node is null)       return                       BSTPrintInorder(node->left)     Print node                       BSTPrintInorder(node->right)  }
查看解析

查看解析

标准答案
Please login to view
思路分析
Let’s break down what post-order traversal means and then evaluate each option step by step. - Post-order traversal of a binary tree visits the left subtree first, then the right subtree, and finally processes the current node (prints its value). This order is L → R → Node. Option 1: - The pseudocode shows: traverse left, then traverse right, then Print node. This exactly matches the L → R → Node sequence required for pos......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!