Hi,
I have created a class which I user to create several list of different values. I am them going through all the list to count for frequency of the values. The problem is I want to consider say value1 = 1, value2 = 2, value3 = 3 to be the same as value1 = 2, value2 = 1, value3 = 3 and so on.
Now the way I am currently doing it is which a series of if statement which looks at the possibilities so for a my class called pair(below) I would swap the values around to look if they match. With a three value number I would have 5 possibities and so on.
I am just curious is there a fast way of seeing if the values match as I want them do without going through a number of If statments?
public class MyDictionaryPair : Dictionary<int, Pair>
{
public void Add(int key, int value1, int value2, decimal weight1, decimal weight2, decimal totalWeight)
{
Pair val;
val.Value1 = value1;
val.Weight1 = weight1;
val.Value2 = value2;
val.Weight2 = weight2;
val.TotalWeight = totalWeight;
this.Add(key, val);
}
}
Kind Regards