regarding q2:
if we have all the points , I guess we need to move through left
to right and scan the loop
sort this array during scan using Y-distance.
now you have the array which will have probable of max diameter
from end to end and problem reduce to find out if circle can be
created using this
suppose x, y1 & x y2 are the coord
center = x, (y1+y2)/2
circle(x, y) = x^2 + y^2 - r^2
check for all the points in the array which are under range r < x <
r if any of them lies inside the circle
otherwise that is the max diameter.
really a lot to code and to tackle many corner cases :( feeling
lazy....
On Aug 30, 12:42 pm, ravi maggon <[email protected]> wrote:
> One more ques asked was:
> output of printf("%x",-l<<4);
> where l can be any positive number.
>
>
>
>
>
>
>
>
>
> On Tue, Aug 30, 2011 at 1:11 PM, ravi maggon <[email protected]> wrote:
> > @birju:
> > I am elaborating 2nd ques below:
> > let us suppose their is 2-d array say A[100][2];
> > here 100 signifies that their are 100 coordinates given and 2 signify that
> > you have x and y in A[][0] and A[][1] respectively.
> > When you join the points in some order they form a closed loop of any shape
> > in a given plane.
> > You need to tell the max diameter of circle which can be placed in that fig
> > formed by joining above coordinates.
>
> > On Tue, Aug 30, 2011 at 12:15 AM, Brijesh
> > <[email protected]>wrote:
>
> >> Yaar second question thoda elaborate kar.. didn't get it !
>
> >> --
> >> 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/-/3ClTQN8-GBEJ.
>
> >> 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/algogeeks?hl=en.
>
> > --
>
> > Regards
> > Ravi Maggon
>
> --
>
> Regards
> Ravi Maggon
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" 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/algogeeks?hl=en.