COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Pre-, In-and Post-order
|
|
Pro-, In-and Past-order
|
|
Pre-, Out-and Post-order
|
|
Pre-, In-and New-order
|
Detailed explanation-1: -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-2: -Tree Traversals (Inorder, Preorder and Postorder)-GeeksforGeeks.
Detailed explanation-3: -What is common in three different types of traversals (Inorder, Preorder and Postorder)? a)Root is visited before right subtreeb)Left subtree is always visited before right subtreec)Root is visited after left subtreed)All of the abovee)None of the aboveCorrect answer is option ‘B’.
Detailed explanation-4: -The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of following is post-order traversal of the tree? Thus, L N M O Q P T will be the post-order traversal.
Detailed explanation-5: -Based on the order of visiting the nodes, DFS traversal on a binary tree can be divided into the following three types: Inorder traversal, preorder traversal, and postorder traversal.