I have a file which has data in the following format
A B
-----
40 3
50 2
60 1
I have to read the file and store it in a data structure that should help me manipulating the data.
If it is C I would go with linked list. What should I possibly use for C#?
I would go with a
Dictionary<TKey, TValue>. You can see the MSDN Reference here.With a dictionary you can store these as key/value pairs of type int (if that datatype would persist through your collection). So this would be a
Dictionary<int, int>.The
Dictionary<int, int>would come in handy if you wanted to have these two values have an understood relationship between them.