Here is one approach which works :)

Traverse the list from a pointer name ptr
when encounter odd then start traversing from a tmp pointer (start point is
ptr->next) to find even no. when find it swap the numbers.
then again start forwarding ptr. If during traversing  ptr==tmp make
flag=0(at start make it flag=1) if again ptr encounter odd then if flag=0
then tmp=ptr->next else tmp=tmp->next
do it until tmp or ptr becomes null. :)
I hope no questions :) :)

On Thu, Jun 30, 2011 at 12:01 PM, Rohan Kalra <ronziiretu...@gmail.com>wrote:

> http://geeksforgeeks.org/?p=12000
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/OnLux79bj3MJ.
>
> 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.
>



-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

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