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
data-structures
I'm looking for a data structure for working with a set of data which is most efficient to do the following :
- Check whether an item has been categorized or not. (The categorized and uncategorized set are disjoint sets).
- Get the category of an item.
- Get all the items in a particular category.
- Get all the uncategorized items.
- 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