public void Week4_Q2() { var s = "AACGATAGCGGTAGA$"; var order = SuffixArray.SortCharacters(s, SuffixArray.NucleotideAlphabet); var actual = SuffixArray.ComputeCharClasses(s, order); Console.WriteLine(string.Join(",", actual.Select(i => i.ToString()))); }
public void Week4_Q6() { var s = "AACGATAGCGGTAGA$"; var order = SuffixArray.SortCharacters(s, SuffixArray.NucleotideAlphabet); var classes = SuffixArray.ComputeCharClasses(s, order); var l = 1; while (l < s.Length) { order = SuffixArray.SortDoubled(s, l, order, classes); classes = SuffixArray.UpdateClasses(order, classes, l); l = 2 * l; } Console.WriteLine(string.Join(",", order.Select(i => i.ToString()))); }