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.com>wrote: > @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.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. >> > > -- > 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.