public void InList(int inf) { Node p = new Node(inf, head); if (ListIsEmpty()) { head = p; tail = p; } else { tail.next = p; tail = p; tail.next = head; } count++; }
public void Delete(int index) { if (index != 0) { Node p = head; for (int i = 0; i < index - 1; i++) p = p.next; if (p.next != null) p.next = p.next.next; } else { head = head.next; tail.next = head; } count--; }
public Node(int inf, Node next) { this.inf = inf; this.next = next; }
public MyList() { head = null; tail = null; count = 0; }