Efficient Data Structure Questions
jeffrey.b.layton at lmco.com
Sun Aug 25 14:10:58 CEST 2002
I'm struggling with a data structure design problem.
It basically boils down to a list of dictionaries or a dictionary
Here's the basic scenario. I have 3 keys I need to track,
'key1', 'key2', 'key3'. Now I could organize the data using
a list of dictionaries like the following:
dummy['key3']=[1, 2, 3, 4, 5]
dummy['key3']=[6, 7, 8, 9, 10]
(BTW, FM is a 'Borg' class).
The other way is to something like this.
FM.keywords['key1']=["string1", "string2", ... ]
FM.keywords['key2']=[0, 1, ... ]
I need to search through 'key1' for a match to a string and
then get the 'key2' and 'key3' data associated with the
matched value of 'key1'.
Does anyone have any suggestions as to the most efficient
data structure? (I like efficiency but I also like ease of coding).
Can anyone explain why one is better than the other (I know
that's subjective, but I'm looking to learn something from
Lockheed-Martin Aeronautical Company - Marietta
Aerodynamics & CFD
email: jeffrey.b.layton at lmco.com
More information about the Python-list