Esempio n. 1
0
        /// <summary>
        /// Removes a value from the queue and returns it.
        /// </summary>
        /// <returns>the removed value</returns>
        public T Remove()
        {
            T temp = first.GetValue();

            first = first.GetNext();
            if (first == null)
            {
                last = null;
            }
            return(temp);
        }
Esempio n. 2
0
        /// <summary>
        /// Provides queue content description
        /// </summary>
        /// <returns>string with queue content</returns>
        public override string ToString()
        {
            String s = "<- ";

            for (Node <T> node = first; node != null; node = node.GetNext())
            {
                s += node.GetValue() + " ";
            }
            s += "<-";
            return(s);
        }
Esempio n. 3
0
        //-------------------------------------
        public override string ToString()
        {
            string st = "[";

            Node <T> pos = this.first;

            while (pos != null)
            {
                st += pos.GetValue() + "-->";

                pos = pos.GetNext();
            }

            st += "Null]";

            return(st);
        }