Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?

Q & ACategory: Data StructureCan a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?
Admin Staff asked 4 years ago

Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?
a) Yes just traverse through the array and form the tree
b) No we need one more traversal to form a tree
c) No in case of sparse trees
d) Yes by using both inorder and array elements

1 Answers
Admin Staff answered 4 years ago

b) No we need one more traversal to form a tree