public void Dequeue()
        {
            if (length == 0)
            {
                Console.WriteLine("no data in queue");
                return;
            }

            Console.WriteLine("dequeued item is = " + first.value);
            var item = first;

            first = first.next;
            length--;
        }
        public void Enqueue(object value)
        {
            if (length == 0)
            {
                CreateFirstNode(value);
                return;
            }

            var newLast = new queueNode(value);

            last.next = newLast;
            last      = newLast;
            length++;
        }
 private void CreateFirstNode(object value)
 {
     first = new queueNode(value);
     last  = first;
     length++;
 }
 public QueueWithLinkedList()
 {
     first  = null;
     last   = first;
     length = 0;
 }
 public queueNode(object _value)
 {
     value = _value;
     next  = null;
 }