public class LinkedList public class Cell public int num public Cell n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class LinkedList
{
public class Cell
{
public int num;
public Cell next;
public Cell(int num, Cell next)
{
this.num = num;
this.next = next;
}
}
public Cell head = null, tail = null;
public int count = 0;
public void Add(int num)
{
if (head == null)
{
head = new Cell(num, null);
tail = head;
}
else
{
tail.next = new Cell(num, null);
tail = tail.next;
}
count++;
}