[Solved] How to match two values in an array?


Why use arrays when you can use a sorted dictionary? take a look at this code example:

SortedDictionary<int, int> sd = new SortedDictionary<int, int>();
sd.Add(1, 54);
sd.Add(5, 12);
sd.Add(3, 17);
sd.Add(9, 1);
sd.Add(2, 44);
MessageBox.Show("First: " + sd[sd.Keys.ElementAt<int>(0)].ToString() + "\nLast: " + sd[sd.Keys.ElementAt<int>(sd.Count-1)].ToString());

solved How to match two values in an array?