Data pair mapping data structure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan T

    Data pair mapping data structure

    I have pairs of data:
    peter - manager
    mary - secretary
    john - accountant
    alan - security

    What data structure is suitable for storing these data pairs so that I can
    get the counterpart ?
    If I have peter then I want to know he is a manager.


  • Frans Bouma [C# MVP]

    #2
    Re: Data pair mapping data structure

    Alan T wrote:
    I have pairs of data:
    peter - manager
    mary - secretary
    john - accountant
    alan - security
    >
    What data structure is suitable for storing these data pairs so that
    I can get the counterpart ?
    If I have peter then I want to know he is a manager.
    You could opt for a hashtable, with the name as the key and the
    jobdescription as the value.

    This only works if the name is unique of course :).

    FB

    --
    ------------------------------------------------------------------------
    Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
    LLBLGen Pro website: http://www.llblgen.com
    My .NET blog: http://weblogs.asp.net/fbouma
    Microsoft MVP (C#)
    ------------------------------------------------------------------------

    Comment

    Working...