hmadhi has asked for the wisdom of the Perl Monks concerning the following question:
I have two AoH @AoH_curr and @AoH_prev. There are about 10,000 rows in each array
eg@AoH_curr[$i]{'node'} @AoH_curr[$i]{'link'} @AoH_curr[$i]{'load'} @AoH_prev[$j]{'node'} @AoH_prev[$j]{'link'} @AoH_prev[$j]{'load'}
I would like to compare the node and link of @AoH_curr and @AoH_prev and if they are equal print out the load value for current and previous.
I need a way to do this. I have tried nested loops but it is taking way to long. Any ideas on a fast algorithm.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing elements in Array of Hashes (AoH)
by moritz (Cardinal) on Jul 18, 2012 at 14:14 UTC | |
|
Re: Comparing elements in Array of Hashes (AoH)
by BrowserUk (Patriarch) on Jul 18, 2012 at 14:44 UTC | |
|
Re: Comparing elements in Array of Hashes (AoH)
by locked_user sundialsvc4 (Abbot) on Jul 18, 2012 at 15:09 UTC | |
|
Re: Comparing elements in Array of Hashes (AoH)
by dolmen (Beadle) on Jul 18, 2012 at 14:11 UTC | |
by hmadhi (Acolyte) on Jul 18, 2012 at 14:18 UTC | |
|
Re: Comparing elements in Array of Hashes (AoH)
by tobyink (Canon) on Jul 18, 2012 at 14:15 UTC | |
by hmadhi (Acolyte) on Jul 18, 2012 at 14:23 UTC | |
by tobyink (Canon) on Jul 18, 2012 at 14:29 UTC | |
|
Re: Comparing elements in Array of Hashes (AoH)
by gri6507 (Deacon) on Jul 18, 2012 at 14:16 UTC |