Pergunta de entrevista da empresa Synopsys

Algo to find if two Binary Trees are structurally equivalent

Resposta da entrevista

Sigiloso

16 de ago. de 2012

this can be done with just 2 pointers , 1 for each binary tree. make any order traversal in first tree and see weather the same traversal is possible in 2nd tree irrespective of the values present in it... if any of the condition violates, return false... if both reaches NULL at the same time.... return true..