/// <summary> /// 求链表的中间结点 /// </summary> public static void GetMidNode() { var linkNode = new SingleLinkNode <int>(); for (int i = 1; i < 10; i++) { linkNode.AddLast(i); } }
/// <summary> /// 单链表反转 /// </summary> public static void ReverseSingleLinkNode() { var linkNode = new SingleLinkNode <int>(); for (int i = 1; i < 10; i++) { linkNode.AddLast(i); } linkNode.Reverse(); Console.WriteLine(linkNode); }
public void Clear() { LinkNode = new SingleLinkNode <T>(); }