India’s Best Job Seekers and Training Platform Forums Algorithm Solutions Discussion Given 2 trees T1 & T2 (both can have > 2 childs) …

  • Given 2 trees T1 & T2 (both can have > 2 childs) …

  • Akash 

    Administrator
    at

    Given 2 trees T1 & T2 (both can have > 2 childs), write an algorithm to find if T2 is a subtree of T1.

    Follow up question, for any branch in T1

    a->b->c->d

    the following is a valid branch in tree T2(i.e. the isSubTree() algorithm mush evaluate to true in below circumstances)

    a->d

    a->c->d

    c->d

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report

Close