Rowwise iteration of a dictionay object

Posted by mono on Stack Overflow See other posts from Stack Overflow or by mono
Published on 2010-05-07T08:05:49Z Indexed on 2010/05/07 8:08 UTC
Read the original article Hit count: 195

Filed under:
|

I have a dictionary object like:

Dictionary<string, HashSet<int>> dict = new Dictionary<string, HashSet<int>>();
        dict.Add("foo", new HashSet<int>() { 15,12,16,18});
        dict.Add("boo", new HashSet<int>() { 16,47,45,21 });

I have to print in such a way such that result would be as following at each iteration:

It1: foo    boo  //only the key in a row
It2: 15     16
It3: 16     47

Can anyone help me to achieve this. Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about data-structures