public void Fill2() { for (int i = 10; i <= 1000 * 1000; i++) { Cup cup = new Cup(i); CupList.Add(cup); } CupMax = CupList.Max(x => x.Number); }
public Data2(string inputData) { foreach (char c in inputData) { Cup cup = new Cup(c - '0'); CupList.Add(cup); } CupMax = CupList.Max(x => x.Number); }
public void Link() { for (int i = 0; i < CupList.Count - 1; i++) { CupList[i].Next = CupList[i + 1]; CupList[i + 1].Prev = CupList[i]; } CupList[0].Prev = CupList[CupList.Count - 1]; CupList[CupList.Count - 1].Next = CupList[0]; CurrentCup = CupList[0]; OrderedCupList = CupList.OrderBy(x => x.Number).ToList(); }