COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
B C K M V S L G
|
|
B C M V K S L G
|
|
B C K M S V L G
|
|
B C K L S M V G
|
Detailed explanation-1: -Inorder Traversal. An inorder traversal first visits the left child (including its entire subtree), then visits the node, and finally visits the right child (including its entire subtree). The binary search tree makes use of this traversal to print all nodes in ascending order of value.
Detailed explanation-2: -For Inorder, you traverse from the left subtree to the root then to the right subtree. For Preorder, you traverse from the root to the left subtree then to the right subtree. For Post order, you traverse from the left subtree to the right subtree then to the root.
Detailed explanation-3: -The correct solution is ‘option 1’. Visit the root node. Traverse the left subtree ( call Algo Preorder(left-subtree) ).
Detailed explanation-4: -Inorder traversal of BST prints it in ascending order.