hii,

Small correction

For the second case,

Consider,

A -> B -> C -> NULL

Initially temp is pointing to A.

Accor 2 me he has asked to reverse d list to make it as C -> A by deleting
B, which can be done like this,

temp->next = temp->next->next; // A->C->NULL
temp->next->next = temp; //A->C->A
temp = temp->next; //C->A->C
temp->next->next = NULL; //C->A->NULL

Correct me, If am wrong

Thanks,

On Fri, Apr 8, 2011 at 4:47 PM, murthy.krishn...@gmail.com <
murthy.krishn...@gmail.com> wrote:

> For the second case,
>
> Consider,
>
> A -> B -> C -> NULL
>
> Accor 2 me he has asked to reverse d list to make it as C -> A by deleting
> B, which can be done like this,
>
> temp->next = temp->next->next; // A->C->NULL
> temp->next->next = temp; //A->C->A
> temp = temp->next; //C->A->C
> temp->next->next = NULL; //C->A->NULL
>
> Correct me, If am wrong
>
> Thanks,
>
>
>
> now temp is poiting to
> On Fri, Apr 8, 2011 at 2:13 PM, cegprakash <cegprak...@gmail.com> wrote:
>
>> for the second case it is possible only if the node contains the
>> previous node's address. Else there should be data movement
>>
>> --
>> 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.
>>
>>
>
>
> --
> P.V.N.S.S. Krishna Murthy,
> Intern at Broadcom Private Limited,
> Bangalore,
> Contact no:- +919845812996.
>
>


-- 
P.V.N.S.S. Krishna Murthy,
Intern at Broadcom Private Limited,
Bangalore,
Contact no:- +919845812996.

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

Reply via email to