CSharp - LinkedList<T> Type

Introduction

LinkedList<T> is a generic doubly linked list.

Here's a demonstration on the use of LinkedList<string>:

Demo

using System;
using System.Collections.Generic;
class MainClass/*from   ww w.j a va 2 s  . co  m*/
{
   public static void Main(string[] args)
   {
         var tune = new LinkedList<string>();
         tune.AddFirst ("A");
         tune.AddLast ("B");

         tune.AddAfter (tune.First, "C");
         tune.AddAfter (tune.First.Next, "D");
         tune.AddBefore (tune.Last, "E");

         tune.RemoveFirst();
         tune.RemoveLast();

         LinkedListNode<string> miNode = tune.Find ("A");
         tune.Remove (miNode);
         tune.AddFirst (miNode);

         foreach (string s in tune)
            Console.WriteLine (s);
   }
}

Result