Re: Intersection for each pair of arrays

2006-08-23 Thread Adriano Ferreira
On 8/23/06, Derek B. Smith <[EMAIL PROTECTED]> wrote: From the previous emails, I do not understand what parts of this code is doing and why is this practical? The part is $union{$e} = 1 and $isect{$e} = 1 . Also %count is never used. It seems like Andrej made some mistakes in his code. I thin

Re: Intersection for each pair of arrays

2006-08-23 Thread Derek B. Smith
>From the previous emails, I do not understand what parts of this code is doing and why is this practical? The part is $union{$e} = 1 and $isect{$e} = 1 . Also %count is never used. thank you derek use warnings; @a = (1, 3, 5, 6, 7, 8); @b = (2, 3, 5, 7, 9); @union = @intersect= (); %union =

Re: Intersection for each pair of arrays

2006-08-23 Thread Mumia W.
On 08/23/2006 09:58 AM, Andrej Kastrin wrote: Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. You could turn your code into a function and call it f

Re: Intersection for each pair of arrays

2006-08-23 Thread Tom Phoenix
On 8/23/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote: below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Use a pair of nested loops; the outer picks one item f

Intersection for each pair of arrays

2006-08-23 Thread Andrej Kastrin
Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Thanks in advance for any suggestion, Andrej ## use warnings; @a = (1, 3, 5, 6, 7