Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of the same binary tree

Thanh Thảo

New member
Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is _________
A. A, C, D, B, E
B. A, B, C, D, E
C. A, B, C, E, D
D. D, B, E, A, C
 
Answer: B
Explanation: The inorder sequence is B, E, A, D, C and Preorder sequence is A, B, E, C, D. The tree constructed with the inorder and preorder sequence is
The levelorder traversal (BFS traversal) is A, B, C, E, D.
 

Tìm kiếm

Back
Top