Essential C# Overview of C# collections  Suggest an edit

LinkedList<T>

// initialize a LinkedList of integers
LinkedList list = new LinkedList<int>();

// add some numbers to our list.
list.AddLast(3);
list.AddLast(5);
list.AddLast(8);

// the list currently is 3, 5, 8

list.AddFirst(2);
// the list now is 2, 3, 5, 8

list.RemoveFirst();
// the list is now 3, 5, 8

list.RemoveLast();
// the list is now 3, 5

Note that LinkedList represents the doubly linked list. So, it’s simply collection of nodes and each node contains an element of type T. Each node is linked to the preceding node and the following node.


Table Of Contents
22 Enum
24 Overview of C# collections
25 GUID
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close