Ejemplo n.º 1
0
 public void insert(int n)
 {
     if (head == null && tail == null)
     {
         head = new linkedListNode(n);
         tail = head;
     }
     else
     {
         tail.next = new linkedListNode(n);
         tail      = tail.next;
     }
 }
Ejemplo n.º 2
0
 public linkedList()
 {
     head = null;
     tail = null;
 }
Ejemplo n.º 3
0
 public linkedListNode(int input)
 {
     this.n    = input;
     this.next = null;
 }