Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 307 Weeks Ago, 4 Days Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
a. Draw a binary tree with 10 nodes labeled 0, 1, . . . , 9 in such a way that the in order and post order traversals of the tree yield the following lists: 9, 3, 1, 0, 4, 2, 7, 6, 8, 5 (in order) and 9, 1, 4, 0, 3, 6, 7, 5, 8, 2 (post order).
b. Give an example of two permutations of the same n labels 0, 1, . . . , n – 1 that cannot be in order and post order 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, . . . , n − 1 are generated by the in order and post order traversals of the tree. Your algorithm should also identify inputs for which the problem has no solution.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll