Ejemplo n.º 1
0
        public LoopNode RemoveNext()
        {
            LoopNode endNode  = this;
            LoopNode nextNode = this.Next().Next();

            this._next = nextNode;
            while (nextNode._next != null)
            {
                nextNode = nextNode._next;
                endNode  = nextNode;
            }
            return(endNode);
        }
Ejemplo n.º 2
0
        public void Delete(LoopNode node)
        {
            LoopNode prevNode    = this;
            LoopNode currentNode = this;

            while (currentNode != null)
            {
                if (currentNode.Next() == node)
                {
                    LoopNode nextNode = currentNode.Next().Next();
                    prevNode    = currentNode;
                    currentNode = nextNode;
                    break;
                }
                else
                {
                    LoopNode nextNode = currentNode.Next();
                    currentNode = nextNode;
                }
            }
            prevNode._next = currentNode;
            //return prevNode;
        }