private void populateSeqPairs(ItemPairsCount seqPairs, string[] seq) { for (int i = 0; i < seq.Count() - 1; i++) { ItemPair pair = new ItemPair(seq[i], seq[i + 1]); seqPairs.addPair(pair); } }
private void populateAllPairs(ItemPairsCount allPairs, string[] seq) { string[] distinctSeq = seq.Distinct().ToArray(); for (int i = 0; i < distinctSeq.Count() - 1; i++) { for (int j = i + 1; j < distinctSeq.Count(); j++) { ItemPair pair = seq[i].CompareTo(seq[j]) < 0 ? new ItemPair(seq[i], seq[j]) : new ItemPair(seq[j], seq[i]); allPairs.addPair(pair); } } }