0

Hello,

I am trying to create a collection that will store boolean relationships between a list of numbers. Normally I would create a 2d array but these numbers will always be dynamically changing. Sometimes there will be more numbers and sometimes less. What collection type can I use to store an unspecified amount of data that behaves like a 2d array??

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by gusano79
0

I am trying to create a collection that will store boolean relationships between a list of numbers. Normally I would create a 2d array but these numbers will always be dynamically changing. Sometimes there will be more numbers and sometimes less. What collection type can I use to store an unspecified amount of data that behaves like a 2d array??

I recommend some kind of dictionary collection, where the keys are instances of a class that holds the two numbers, and the values are the Boolean relationship. It still works like a two-dimensional array because you're keying the collection using pairs of numbers, but you only have to put in the number pairs you need.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.