Ejemplo n.º 1
0
        }     //End of public void Enqueue(int data)

        public int Dequeue()
        {
            if (_head == null)
            {
                throw new Exception("Queue is Empty");
            }//End of if
            int _result = _head.Data;

            _head = _head.Next;
            return(_result);
        }//End of public int Dequeue()
Ejemplo n.º 2
0
        public void Enqueue(int data)
        {
            LLnode _newNode = new LLnode(data);

            if (_head == null)
            {
                _head = _newNode;
                _end  = _head;
            }//End of if
            else
            {
                _end.Next = _newNode;
                _end      = _end.Next;
            } //End of else
            _count++;
        }     //End of public void Enqueue(int data)