Csharp/C Sharp by API/System.Collections.Generic/LinkedList — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:11, 26 мая 2010
LinkedList.AddBefore
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;
}
}
}
LinkedList.AddFirst
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;
}
}
}
LinkedList.AddLast
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;
}
}
}
LinkedList.First
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;
}
}
}