public override string ToString() { string s = ""; Elem <T> p = Beg; if (p == null) { s = "Список пустой"; } else { while (p != null) { s = s + p.ToString() + " "; p = p.Next; } } return(s); }