public int Leer() { _Nodo P = COLA_PRIMERO; int dato; if (P != null) { dato = P.dato; COLA_PRIMERO = P.siguiente; } else { COLA_PRIMERO = null; COLA_ULTIMO = null; dato = -1; } return(dato); }
public void Insertar(int dato) { _Nodo P = new _Nodo(); P.dato = dato; P.siguiente = null; if (COLA_ULTIMO != null) { COLA_ULTIMO.siguiente = P; } if (COLA_PRIMERO == null) { COLA_PRIMERO = P; } COLA_ULTIMO = P; }