On Sep 14, 2:25 pm, StevieT <[email protected]> wrote:
> I think a lot of people failed on ternary search because they failed
> to correctly consider the case where the centre of mass is not moving.
> In this case, all inputs to the function evaluate to the same output,
> so the position you converge to depends on how you coded the
> algorithm.

Yes, you are right. I was wondering why my solution didnt work. Now i
know, ternary search expects a parabolic graph. Where else, in case of
zero movement of the center of mass, we will get a straight line and
ternary search is sure to fail. The same was happening with my code. I
have fixed it now though.

Thanks. :)

- Rajat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" 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/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to