VMWare Inc Interview Question for Software Engineer / Developers






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

We may do it recursively like postorder traversal

- Lei February 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Since it is a BST, We need to do a inorder traversal.
And for each node traversed add a link to the previous element as well as the next element.

- Anonymous April 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I agree with him. We should a do inorder traversal to make sorted doubly link list.

- Hitesh July 31, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

how the relationship holds?

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

Use ordered BST and have two pointers for small and large in BST. While converting use the small pointer as previous and large pointer as next.(small pointer has the address of the node which is lesser than the parent and the large pointer has the address of the node which is greater than the parent.

- Karthikeyan December 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{
Node * conv(Node *N)
{
static Node *H=NULL;
static Node *p=NULL;

Node *t1=N->lc;
Node *t2=N->rc;

if(t1)
conv(t1);

if(!H)
{
H=N;
p=N;
}
else
{
p->rc=N;
N->lc=p;
N->rc=NULL;
p=N;
}

if(t2)
conv(t2);

return H;
}
}

- Nit May 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It should be BFS traversal of the tree and we must add nodes in the list the order in which they are added in the queue during BFS.
Making sorted linked list makes no sense.

- Heramb April 09, 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