1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text;
namespace list { class Program { static void Main(string[] args) { LinkedList<int> LinkList; List<LinkedListNode<int>> Lnode; LinkList = new LinkedList<int>(); Lnode = new List<LinkedListNode<int>>(); Lnode.Add(new LinkedListNode<int>(3)); Lnode.Add(new LinkedListNode<int>(1)); Lnode.Add(new LinkedListNode<int>(2)); LinkList.AddFirst(Lnode[2]); LinkList.AddBefore(Lnode[2],Lnode[1]); LinkList.AddAfter(Lnode[2],Lnode[0]);
foreach (int doc in LinkList) { Console.WriteLine(doc); }
} } }
|