More comments on Ashish's approach. When implementing, you could
reverse the list when you see it's in descending order. Then merge
would be easier.

On Mar 3, 1:03 am, Ashish Goel <ashg...@gmail.com> wrote:
> find two consecutive sequences(can be two increasing2I, 1i1d,1d1i,2D), merge
> them and then merge every next sequence with this merged sequence
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
>
>
>
>
>
> On Wed, Mar 2, 2011 at 8:33 PM, Shreyas VA <v.a.shre...@gmail.com> wrote:
> > I think in this case bubble sort with early exit will be efficient
>
> > On Wed, Mar 2, 2011 at 8:16 PM, snehal jain <learner....@gmail.com> wrote:
>
> >> The LL is in alternating ascending and descendin orders. Sort the list
> >> efficiently
> >> egs: 1->2->3->12->11->2->10->6->NULL
>
> >> --
> >> 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.

Reply via email to