override public string ToString() { string s = "]"; for (Node <T> curr = first; curr != null; curr = curr.GetNext()) { s += " " + curr.GetValue(); s += curr.GetNext() == null ? " ]" : ","; } return(s); }
public T Pop() { if (first == null) { return(default(T)); } T tmp = first.GetValue(); first = first.GetNext(); return(tmp); }
public int Size() { Node <T> pos = this.first; int count = 0; while (pos != null) { count++; pos = pos.GetNext(); } return(count); }
public override string ToString() { string st = "["; Node <T> pos = this.first; while (pos != null) { st += pos.GetValue() + "-->"; pos = pos.GetNext(); } st += "Null]"; return(st); }