LinkedList : Generic LinkedList : Data Structure C# Examples


C# Examples » Data Structure » Generic LinkedList »

 

LinkedList









    
using  System;
using  System.Collections;
using  System.Collections.Generic;
using  System.Collections.ObjectModel;
using  System.Text;


public  class  MainClass
{
        public  static  void  Main()
        {
                LinkedList<int>  list  =  new  LinkedList<int>();

                list.AddFirst(10);                          
                list.AddLast(15);                            
                list.AddLast(3);                              
                list.AddLast(99);                            
                list.AddBefore(list.Last,  25);  

                LinkedListNode<int>  node  =  list.First;
                while  (node  !=  null)
                {
                        Console.WriteLine(node.Value);
                        node  =  node.Next;
                }
        }
}
    
   
  
   



Output

10
15
3
25
99


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Generic LinkedList