CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    5

    Associative Array / Hash Table?

    I need an array or list or hash table that will allow me to have keys that are not unique, for example:

    "table_name1", "error in field name"
    "table_name2", "error in field address"
    "table_name2", "error in field zipcode"
    "table_name2", "error in field other"

    etc.. there will be multiple keys but they could have the same names. Another issue is I could be storing up to 1,000,000+ elements so performance is an issue. Any ideas what data structure I can use?

  2. #2
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: Associative Array / Hash Table?

    Hi,

    Are the values unique? Perhaps you can switch the mapping. Any collection that doesn't support unique keys is unlikely to give a performance as good as the hash table or generic dictionary.

  3. #3
    Join Date
    Jan 2010
    Posts
    5

    Re: Associative Array / Hash Table?

    The values will be unique yes, I never thought about switching the mapping, that's a good idea.

  4. #4
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Associative Array / Hash Table?

    NameValueCollection<T> I think handles multiple KVP's with the same Key, but different values.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured