示例#1
0
        internal Node055 Add(Node055 newNode)
        {
            if (_head == null)
            {
                _head = newNode;
                return(newNode);
            }
            var innerHead = _head;

            while (innerHead.Next != null)
            {
                innerHead = innerHead.Next;
            }
            innerHead.Next = newNode;
            return(newNode);
        }
示例#2
0
        internal Node055 MeetNode(Node055 head)
        {
            Node055 point  = head; //指针1
            Node055 point1 = head; //指针2

            while (point1 != null && point1.Next != null)
            {
                point  = point.Next;
                point1 = point1.Next.Next;
                if (point1 == point)
                {
                    return(point1);
                }
            }
            return(null);
        }