BT Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

Do inOrder Traversal of both the BSTs and u'll get 2 sorted arrays (and elements are unique)..so merge these 2 sorted arrays using Merge Sort and there u go :)

- Karthik Vvs November 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the simplest approach would be to take one tree as base, and read (using any traversal) data from the other tree and insert into the base tree. Effectively you will end up merging the two trees.

- inasaa November 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This makes sense if there is no restriction of doing in-place merging.

- BJ November 19, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Both BSTs have unique elements. Does that give any clue? If yes, what's that.

- Anonymous November 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Is there any restriction in terms of creating a height balanced tree?

- Sen February 25, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More