public int NbElment() { int i = 0; EQueue P = head; while (P != null) { i++; P = P.Next; } return(i); }
public Node Dequeue() { EQueue P = head; head = P.Next; if (head == null) { tail = null; } P.Next = null; return(P.Info); }
public void Enqueue(Node X) { EQueue P = new EQueue(X); if (P != null) // will only continue if the allocation is succeed { if (!IsEmpty()) { tail.Next = P; } else { head = P; } tail = P; } }
//Constructor public Queue() { head = null; tail = null; }
//Constructor public EQueue(Node X) { next = null; info = X; }