Course: Numerical Optimization
I've checked on answers for this answer but couldn't get anything.
Kindly answer questions a, b & c as seen in the picture.
Caution!! Please don't provide me with an
incomplete answer. If you don't have an idea, please do not attempt
this question.
3. Algorithm analysis and design (Ex. 4.4-7) a. Draw a binary tree with ten nodes labeled 0, 1, 2, ..., 9 in such a way that the inorder and postorder traversals of the tree yield the following lists: 9, 3, 1, 0, 4, 2, 7, 6, 8, 5 (inorder) and 9, 1, 4, 0, 3, 6, 7, 5, 8, 2 (postorder). b. Give an example of two permutations of the same n labels 0, 1, 2,..., n-1 that cannot be inorder and postorder traversal lists of the same binary tree. c. Design an algorithm that constructs a binary tree for which two given lists of n labels 0, 1, 2, ..., n - 1 are generated by the inorder and postorder traversals of the tree. Your algorithm should also identify inputs for which the problem has no solution.
Course: Numerical Optimization I've checked on answers for this answer but couldn't get anything. Kindly answer questions
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am