public Telement ToArray( )
        {
            Telement[] result = new Telement[Count];

            int  i           = 0;
            Node currentNode = Head;

            while (currentNode != null)
            {
                result[i] = currentNode.Data;
                i++;
                currentNode = currentNode.Next;
            }

            return(result);
        }
        public void AddLast(Telement newData)
        {
            if (newData == null)
            {
                throw new ArgumentNullException( );
            }

            Node newNode = new Node(newData);
            Node oldTail = Tail;

            if (Head == null)
            {
                Head = newNode;
            }
            else
            {
                oldTail.Next = newNode;
            }
            Tail = newNode;

            Count++;
        }
 public Node(Telement newData)
 {
     Next = null; Data = newData;
 }
Beispiel #4
0
 public Data(Tkey key, Telement element)
 {
     Key     = key;
     Element = element;
     Next    = null;
 }