Actually, there is a method to solve this problem in O(3/2 * n)
Assume the maximum value is m, minimum value is n
1. hash these value into a table, with size m - n + 1, cost O(n),
assume this table is noted as H
2. {(x, y) | x + y = z} must be reside in H followed by this condition:
{(x, y)
Actually, there is a method to solve this problem in O(3/2 * n)
Assume the maximum value is m, minimum value is n
1. hash these value into a table, with size m - n + 1, cost O(n),
assume this table is noted as H
2. {(x, y) | x + y = z} must be reside in H followed by this condition:
{(x, y)
Hi,
I think there is a small modification in the equations :
X= (D2 + D1^2)/(2*D1)
Y= (D2 - D1^2)/(2*D1)
Vinodh
You are right. I made a mistake while typing the equation.
Thanks.
swadhin
On 1/2/06, Vinodh Kumar [EMAIL PROTECTED] wrote:
Hi,
I think there is a small modification in the equations :
X= (D2 + D1^2)/(2*D1)
Y= (D2 - D1^2)/(2*D1)
Vinodh