Software Development Programmer Interview Questions

33,184 software development programmer interview questions shared by candidates

11 Answers Given references to roots of two binary trees, how do you short circuit determine whether the sequences of the leaf elements of both the trees are same ? The structure of two BTs may be different. Short circuit : for ex. If the very first leaf element of each tree is different, the algorithm should stop immediately returning false instead of checking all the leaf elements of both trees.
avatar

Software Development Engineer

Interviewed at Amazon

3.5
Feb 17, 2012

11 Answers Given references to roots of two binary trees, how do you short circuit determine whether the sequences of the leaf elements of both the trees are same ? The structure of two BTs may be different. Short circuit : for ex. If the very first leaf element of each tree is different, the algorithm should stop immediately returning false instead of checking all the leaf elements of both trees.

Viewing 931 - 940 interview questions

Glassdoor has 33,184 interview questions and reports from Software development programmer interviews. Prepare for your interview. Get hired. Love your job.