In what order are positions visited during a preorder traversal of the tree
CSCI 321 Computer Science III Spring 2019
Lecture 3 Activity 1
1. In what order are positions visited during a preorder traversal of the tree in Fig 1. Hint: Draw the tree on a separate sheet of paper and then mark nodes as they are visited, writing down the output produced for each visit. Your output should be a sequence like this: “- / * …”.
2. In what order are positions visited during a postorder traversal of the tree in Fig 1. Hint: Draw the tree on a separate sheet of paper and then mark nodes as they are visited, writing down the output produced for each visit. Your output should be a sequence like this: “3 1 + …”.
Hint
Management 1) In what order are positions visited during a preorder traversal of the tree of Figure 8.6?PreOrder : As we know Nodes are Visited in Root Left RightSo ,- / * + 3 1 3 + - 9 5 2 + * 3 - 7 4 6 [Count total we have 19 nodes]2) In what order are positions visited during a postorder traversal of the tree of Figure 8.6?PostOrder : As we know Nodes are Visited in Left Right RootSo ,3 1 ...