edited by
7,965 views
30 30 votes

Which one of the following binary trees has its inorder and preorder traversals as $BCAD$  and $ABCD$, respectively?

5 Answers

Best answer
31 31 votes

Answer is D.

Inorder traversal is left node right.

Preorder is node left right.

edited by
4 4 votes
Inorder traversal 1) Traverse the left subtree 2) Visit the root 3) Traverse the right subtree Preorder traversal 1) Visit the root 2) Traverse the left subtree 3) Traverse the right subtree
4 4 votes
ans is d

in order left-root-right

preorder root-left right

after applying above formula we get exactly what they asking so d is correct
Answer:
Position:
Show:

Related questions

32 32 votes
8 answers 8 answers
10.3k
10.3k views
Ishrat Jahan asked Nov 2, 2014
10,250 views
In the TCP/IP protocol suite, which one of the following is NOT part of the IP header?Fragment OffsetSource IP addressDestination IP addressDestination port number
48 48 votes
7 answers 7 answers
18.2k
18.2k views
Ishrat Jahan asked Nov 2, 2014
18,225 views
A process executes the following segment of code :for(i = 1; i <= n; i++) fork ();The number of new processes created is$n$$((n(n + 1))/2)$$2^n - 1$$3^n - 1$
56 56 votes
6 answers 6 answers
19.2k
19.2k views
Ishrat Jahan asked Nov 2, 2014
19,197 views
Consider the following C program which is supposed to compute the transpose of a given $4 \times 4$ matrix $M$. Note that, there is an $X$ in the program which indicates ...
44 44 votes
3 answers 3 answers
10.3k
10.3k views
Ishrat Jahan asked Nov 2, 2014
10,314 views
If we use internal data forwarding to speed up the performance of a CPU (R1, R2 and R3 are registers and M[100] is a memory reference), then the sequence of operationsR1 ...