/// <summary> /// Removes a value from the queue and returns it. /// </summary> /// <returns>the removed value</returns> public T Remove() { T temp = first.GetValue(); first = first.GetNext(); if (first == null) { last = null; } return(temp); }
/// <summary> /// Provides queue content description /// </summary> /// <returns>string with queue content</returns> public override string ToString() { String s = "<- "; for (Node <T> node = first; node != null; node = node.GetNext()) { s += node.GetValue() + " "; } s += "<-"; return(s); }
//------------------------------------- public override string ToString() { string st = "["; Node <T> pos = this.first; while (pos != null) { st += pos.GetValue() + "-->"; pos = pos.GetNext(); } st += "Null]"; return(st); }