Janaki has asked for the wisdom of the Perl Monks concerning the following question:
Hi,I stuck with a problem.I have two arrays @a=(1,1,2,3,4,4,8,8); @b=(3,4,3,5,6,7,9,10); What I need is, 1 is related to 3(they have same index )again 1 is related 4.Now 3 is related to 2,3 is related to 5,4 related to 6,4 related to 7. Now the required result should be "1,2,3,4,5,6,7 have relation to each other". Again the program should be able to find the related numbers among the other elements in the array.Here next result is "8,9,10 have relation to each other". I have tried to use hash but keys having same value created problem.How can I solve this problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: to find inter connected items
by choroba (Cardinal) on Nov 04, 2012 at 08:26 UTC | |
|
Re: to find inter-connected items
by Athanasius (Archbishop) on Nov 05, 2012 at 04:43 UTC | |
|
Re: to find inter connected items
by BillKSmith (Monsignor) on Nov 04, 2012 at 15:52 UTC | |
|
Re: to find inter connected items
by jaredor (Priest) on Nov 05, 2012 at 03:42 UTC | |
|
Re: to find inter connected items
by remiah (Hermit) on Nov 05, 2012 at 11:27 UTC | |
|
Re: to find inter connected items
by space_monk (Chaplain) on Nov 04, 2012 at 13:15 UTC | |
by Janaki (Initiate) on Nov 05, 2012 at 05:06 UTC |