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* fro

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) {

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 wrote: > Does each node in the list have three pointers? > What do you mean by straight doubly link lis

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 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

[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 "Algo