public void Add(Country dataToFind, Country afterData) { if (this.Next == null) { Console.WriteLine("Не найдено!"); return; } if (this.Data.GetName() == dataToFind.GetName() && this.Data.GetPopulation() == dataToFind.GetPopulation()) { Node2 node = new Node2(afterData); node.Next = this.Next; node.Pred = this; this.Next = node; return; } this.Next.Add(dataToFind, afterData); }
public Node2(Country data) { Data = data; Next = null; Pred = null; }
public Node2() { Data = default(Country); Next = null; Pred = null; }