When in-order traversing a tree resulted in E A C K F H D B G; the preorder traversal would return?
Answer: FAEKCDHGB
Explanation
E: This is the leftmost node in the in-order sequence. It becomes the root in the preorder traversal.
A: The next node after E is its left child. So, A is the left child of E.
C: Moving further, C is the right child of A.
K: K is the right child of C.
F: F is the right child of K.
H: H is the right child of F.
D: D is the left child of F.
B: B is the left child of A.
G: Finally, G is the right child of B.
Putting it all together, we get the preorder traversal: FAEKCDHGB.
This question appeared in
Past Papers (3 times)
KPPSC Past Papers (1 times)
Sindh University Past Papers and Syllabus (2 times)
This question appeared in
Subjects (3 times)
MATHS MCQS (3 times)
Related MCQs
- There are 8 mango trees in a straight line Distance between each tree is 3 meters. What is the distance between the first tree and the eighth tree?
- The process by which companies credit value for customer and build strong customer relationship in order to capture value from customer in return is called ____.
- Which traversal algorithm is used in the breadth-first search (BFS) of a graph?
- The angle of elevation of the sun, when the length of the shadow of a tree is equal to the height of the tree is?
- Ali is standing 10 meters away from a tree. The distance of his eyes from his feet is 1.5 meter. Given that the distance from his eyes to the top of the tree is 15 meters, find the height of the tree
- An order under Rule 9, Order IX, rejecting an application for an order to set aside the dismissal of a suit is______?
- War of 1965 resulted in signing of?
- I planted ____ tree ? in my garden last year. ____ tree ? has now grown big.
- MRI or CT scan resulted from the image exploration of ______?
- The ongoing Israel-Palestine crisis resulted from which 1947 decision?