public void InsertNode(T value) { SingleListNode <T> Node = new SingleListNode <T>(value); Node.Next = this.Head; this.Head = Node; }
public void Reverse() { SingleListNode <T> p1 = null; SingleListNode <T> p2 = null; p1 = this.Head; if (p1 != null) { p2 = p1.Next; } while (p2 != null) { p1.Next = p2.Next; p2.Next = this.Head; this.Head = p2; p2 = p1.Next; } }
public void Clean() { this.Head = null; }
public SingleListNode(T value) { this.Value = value; this.Next = null; }