you're right. I didn't understand it. your solution is correct. My
version would only work in cases in which we didn't need to print the
same minimum sum as many times as it appears. . .but it wouldn't even
be very good at this.
In other words, I solved a completely different problem, yes?
I think this one might have some optimal substructure, though it's not
exactly clear what that may be. I'll give it some thought.
On Dec 1, 6:26 am, smartdude [EMAIL PROTECTED] wrote:
Reading about hamming distance and clustering methods might help.
bullockbefriending bard wrote:
A single
I doubt there is any solution better than O(n lg n). . .the max heap
sounds good to me.
On Nov 30, 1:15 am, yogesh [EMAIL PROTECTED] wrote:
On Nov 28, 10:27 pm, Andre [EMAIL PROTECTED] wrote:
Hi,
I was thinking to do something like this, but is it an efficient way to
do it?
Do you know
may be right, but how about this:
On input sorted arrays L and R
output[0] = L[0]+R[0]
i=0
j=0
p=0
for n=1 to k-1
if i+1size[L]
if j+1size[R]
error can't get k sums
else
j=j+1
else if j+1size[R]
i=i+1
else if
else if L[i+1]+R[j]R[j+1]+L[i]
j = j+1
I've found an implementation that uses whether bc is a 'right turn'
from ab as its sole corvergence criterion (where a b and c are sites
in neighboring regions). The code it uses is:
if ((b.x-a.x)*(c.y-a.y) - (c.x-a.x)*(b.y-a.y) 0)
--~--~-~--~~~---~--~~
You
I just tested it . . .right turn detection did the trick. so there's
your answer.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Better answer for #1 that I'm pretty sure will work:
calculate the center and radius of the circle. if the radius is not
NaN (i.e the sites are not collinear) and the center of the circle is
between the current locations of the breakpoints, they will converge.
On Nov 21, 6:36 am, bordaigorl
Also, in response to your idea, it doesn't make sense. . .you calculate
the center of the circle BY calculating where the bisectors intersect.
Or vice versa. The two values are always equivalent. Also, your fear
about numerical instability is unfounded. Calculating the orthocenter
by bisector