Re: Pairs have minimum difference

2003-01-26 Thread R. Joseph Newton
Nengbing Tao wrote: > Thanks! > > Not quite yet! > Each number can appear once in each column in the end output! This would > work for cases where those pair do not overlap. The problem comes in cases > like > @xa=(900,1000,1010,2040,2010,8000,); > @xb=(899,1005,1022,2020,2000,6000,,2)

Re: Pairs have minimum difference

2003-01-26 Thread Nengbing Tao
Thanks! Not quite yet! Each number can appear once in each column in the end output! This would work for cases where those pair do not overlap. The problem comes in cases like @xa=(900,1000,1010,2040,2010,8000,); @xb=(899,1005,1022,2020,2000,6000,,2); I guess I have to track the vari

Re: Pairs have minimum difference

2003-01-24 Thread david
Nengbing Tao wrote: > -90 87658675 > 9012341324 > -198 47654567 > > Notice that |1500-1485|=|1500-1515|. > how can you have negative if they are abs? anyway, have you try: #!/usr/bin/perl -w use strict; my @xa=(8765,6000,4765,3000,1530,1500,1465,1234,1000); my @xb=(8675,600

RE: Pairs have minimum difference

2003-01-24 Thread Dan Muey
> > Hi, ALL, > > I thought there should be a solution/algorithm already > to this problem and would like to check here first. > > > The problem: To return all the pairs (one number from each > array, one number can only be in one pair) that have the > smallest sum of absolute differ

Pairs have minimum difference

2003-01-24 Thread TAO, NENGBING [AG/1000]
Hi, ALL, I thought there should be a solution/algorithm already to this problem and would like to check here first. The problem: To return all the pairs (one number from each array, one number can only be in one pair) that have the smallest sum of absolute differences from two arrays.

RE: Pairs have minimum difference

2003-01-24 Thread Beau E. Cox
Hi - I'll pass - this looks like HOMEWORK! Please put on your thinking cap and try it... > -Original Message- > From: Nengbing Tao [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 24, 2003 3:00 AM > To: [EMAIL PROTECTED] > Subject: Pairs have minimum differ

Pairs have minimum difference

2003-01-24 Thread Nengbing Tao
Hi, ALL, I thought there should be a solution/algorithm already to this problem and would like to check here first. The problem: To return all the pairs (one number from each array, one number can only be in one pair) that have the smallest sum of absolute differences from two arrays.