Data structure supporting the following operations

Posted by 500865 on Programmers See other posts from Programmers or by 500865
Published on 2013-11-06T01:44:24Z Indexed on 2013/11/06 4:16 UTC
Read the original article Hit count: 189

Filed under:

I'm looking for a data structure for working with a set of data which is most efficient to do the following :

  1. Check whether an item has been categorized or not. (The categorized and uncategorized set are disjoint sets).
  2. Get the category of an item.
  3. Get all the items in a particular category.
  4. Get all the uncategorized items.
  5. Remove a particular item from the data set.

I was thinking of having a Dictionary<String, Set<String>> to hold all the items in a given category, but that doesn't solve 2.

© Programmers or respective owner

Related posts about data-structures