using System; using System.Collections.Generic; namespace ConsoleApplication { class Program { static void Main(string[] args) { LinkedList<int> a = new LinkedList<int>(); a.AddFirst(3); a.AddLast(1); a.AddLast(4); foreach (int i in a) Console.Write(i + " "); Console.WriteLine(); LinkedListNode<int> cur = a.Find(3); //cur對應3所在的位置 a.AddBefore(cur, 2); //在3前面新增2 foreach (int i in a) Console.Write(i + " "); a.Remove(3); a.Clear(); Console.Read(); } } }