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 w w  w.ja  v  a  2  s .  c o 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