@Saurabh You used an extra pointer compared to shiva's code ,you can avoid
that. :)
On Mon, Dec 20, 2010 at 8:24 PM, Saurabh Koar saurabhkoar...@gmail.comwrote:
@Rishi:I think Shiva's code is also fine.U can access the list easily
by using down pointer in his code.
Because he is assigning
@Nikhil: ya..rt
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit
See inline ..
On Sat, Dec 18, 2010 at 12:09 PM, siva viknesh sivavikne...@gmail.comwrote:
Given a linked list structure where every node represents a linked list
and contains two pointers of its type:
(i) pointer to next node in the main list.
(ii) pointer to a linked list where
temp=head;
temp1=temp-fwd;
while(temp-fwd!=NULL)
{
temp2=temp;
while(temp2-down!=NULL)
temp2=temp2-link;
temp2-down=temp1;
temp-fwd=NULL;
temp=temp1;
temp1=temp1-fwd;
}
U can print the linked list using down pointer.Hope this will
work.Correct me if I m wrong.
--
You
@Rishi:I think Shiva's code is also fine.U can access the list easily
by using down pointer in his code.
Because he is assigning temp-down=temp2 and then he is making temp-fwd=NULL.
On 12/20/10, Saurabh Koar saurabhkoar...@gmail.com wrote:
temp=head;
temp1=temp-fwd;
while(temp-fwd!=NULL)
{
@Rishi:I think Shiva's code is also fine.U can access the list easily
by using down pointer in his code.
Because he is assigning temp-down=temp2 and then he is making temp-fwd=NULL.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
Given a linked list structure where every node represents a linked list and
contains two pointers of its type:
(i) pointer to next node in the main list.
(ii) pointer to a linked list where this node is head.
Write a C function to flatten the list into a single linked list.
Eg.
If the given