here how you can do it :-
call construct(head,0,n-1); n=length of linked list
node* construct(node *head,int start,int end)
{
int mid;
if(start > end)
return NULL;
mid=(start+end)/2;
node * tleft=construct(dll,start,mid-1);
head->next=tleft;
head=head->next;
head->prev=construct(dll,mid+1,end);
return head;
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.