Question: Given an array representation of a ternary tree [at most three children] Ar = [A, B ,C,D ,E , null, G, H, null, null,
Given an array representation of a ternary tree [at most three children] Ar = [A, B ,C,D ,E , null, G, H, null, null, X, null, Z, null, W, null, null, null, null, K] i) Draw the tree. [2] I) Write preorder traversal, [1] iii) Write postorder traversal, [1] iv) Write inorder traversal (visit order should be left, then immediate right siblings, then root, and finally right subtree) [1] v) Draw adjacency matrix for the given tree [2] vi) Draw adjacency list for the given tree [2] vii) Write down the general equation for parent child relationship for the given tree. For example, if the parent index is j, then what will be the child indexes? If the child index is k, then what will be the parent index? [1]
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
i The tree iiPreorder Traversal ABEWGCHKDXZ iiiPostorder Traversal WEGBKHCXZDA ivInorder T... View full answer
Get step-by-step solutions from verified subject matter experts
