Re: [algogeeks] Microsoft first round interview question.

2012-08-03 Thread sahil gupta
Each node is having three pointers.
Two are simple *forward and backward* pointers.
Third pointer may point to again similar list or point to null.
Also those list which are pointed by third pointer may again follow similar
fashion.
It's look like a general tree.

Now question is:
To make *DLL* from this structure which means append each list pointed by
third pointer to original one such that it like simple *DLL*.


On Thu, Aug 2, 2012 at 5:45 PM, Navin Kumar algorithm.i...@gmail.comwrote:

 @sahil: Please elaborate your question. I didn't understand your question.

 what is straight doubly linked list?? How many pointers each node have??



 On Thu, Aug 2, 2012 at 4:26 PM, Amit Basak abas...@gmail.com wrote:

 Does each node in the list have three pointers?
 What do you mean by straight doubly link list?


 Thanks,
 Amit





 On Wed, Aug 1, 2012 at 7:25 PM, sahil gupta sahilgupta...@gmail.comwrote:

 There is doubly link list and each node is having another pointer which
 is points to another doubly link list or points to null.
 You need make it straight doubly link list.
 Provide the efficient code.

 Sahil Gupta

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Microsoft first round interview question.

2012-08-02 Thread sahil gupta
There is doubly link list and each node is having another pointer which is
points to another doubly link list or points to null.
You need make it straight doubly link list.
Provide the efficient code.

Sahil Gupta

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft first round interview question.

2012-08-02 Thread Amit Basak
Does each node in the list have three pointers?
What do you mean by straight doubly link list?


Thanks,
Amit





On Wed, Aug 1, 2012 at 7:25 PM, sahil gupta sahilgupta...@gmail.com wrote:

 There is doubly link list and each node is having another pointer which is
 points to another doubly link list or points to null.
 You need make it straight doubly link list.
 Provide the efficient code.

 Sahil Gupta

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft first round interview question.

2012-08-02 Thread Navin Kumar
@sahil: Please elaborate your question. I didn't understand your question.

what is straight doubly linked list?? How many pointers each node have??


On Thu, Aug 2, 2012 at 4:26 PM, Amit Basak abas...@gmail.com wrote:

 Does each node in the list have three pointers?
 What do you mean by straight doubly link list?


 Thanks,
 Amit





 On Wed, Aug 1, 2012 at 7:25 PM, sahil gupta sahilgupta...@gmail.comwrote:

 There is doubly link list and each node is having another pointer which
 is points to another doubly link list or points to null.
 You need make it straight doubly link list.
 Provide the efficient code.

 Sahil Gupta

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft first round interview question.

2012-08-02 Thread Ashish Goel
lets call the additional pointer as child. find the tail and keep attaching
to tail if there is a child...

struct node * makeDLL(struct node *pDLL) {
  if (!pDLL) return pDLL;
  struct node *pTail = pDLL;
  while (pTail-next) pTail = pTail-next;
  struct node *pCurr = pDLL;
  while (pCurr) {
if (pCurr-child) {
  pTail-next = pCurr-child;
  pCurr-child-prev = pTail;
  while (pTail-next) pTail = pTail-next;
}
pCurr= pCurr-next;
  }
  return pDLL;
}



Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Thu, Aug 2, 2012 at 5:45 PM, Navin Kumar algorithm.i...@gmail.comwrote:

 @sahil: Please elaborate your question. I didn't understand your question.

 what is straight doubly linked list?? How many pointers each node have??



 On Thu, Aug 2, 2012 at 4:26 PM, Amit Basak abas...@gmail.com wrote:

 Does each node in the list have three pointers?
 What do you mean by straight doubly link list?


 Thanks,
 Amit





 On Wed, Aug 1, 2012 at 7:25 PM, sahil gupta sahilgupta...@gmail.comwrote:

 There is doubly link list and each node is having another pointer which
 is points to another doubly link list or points to null.
 You need make it straight doubly link list.
 Provide the efficient code.

 Sahil Gupta

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.