DC
BAN USER
Comments (4)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
2
of 2 vote
Regarding Hari's question:
If trees are like this:
1
/ \
2 3
/ \ / \
4 5 6 7
1
/ \
5 6
Then inorder of A: 4251637 and inorder of B: 516. Even though inorder of B is contained in A, B is not a subtree of A. That is why you need to check both types of traversals before declaring one tree is a subtree of another.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Can you please explain the second step with a small example, ie, what to do after building the directed graph?
- DC August 31, 2012