in reply to Common hash keys
What have you tried? Pseudocode would be ...
for all keys in hash-1, where k-1 is current key for all keys in hash-2, where k-2 is current key put k-1 in store if k-1 = k-2 end-for end-for # "store" would have all the common keys in the end
Time passes. Oh yes, finding if any keys are present ...
common set to false for all keys in hash-1, where k-1 is current key for all keys in hash-2, where k-2 is current key if k-1 = k-2, common set to true break out of both loops end-for end-for # test common to check for commonality
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Common hash keys
by moritz (Cardinal) on Jun 07, 2008 at 07:56 UTC | |
by parv (Parson) on Jun 07, 2008 at 08:34 UTC | |
by massa (Hermit) on Jun 07, 2008 at 13:34 UTC | |
by Anonymous Monk on Jun 08, 2008 at 06:56 UTC | |
by parv (Parson) on Jun 08, 2008 at 08:29 UTC | |
by throop (Chaplain) on Jun 08, 2008 at 13:31 UTC | |
|