Data pair mapping data structure

  • Thread starter Thread starter Alan T
  • Start date Start date
A

Alan T

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.
 
Alan said:
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#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top