예제 #1
0
        public ListNode Search(ListNode node)
        {
            var tmp = Head;

            if (Count == 1)
            {
                if (tmp.Equals(node))
                {
                    return(node);
                }
                return(null);
            }

            while (tmp != null)
            {
                if (Equals(tmp, node))
                {
                    return(tmp);
                }
                tmp = tmp.Next;
            }
            return(null);
        }
예제 #2
0
        public ListNode Search(string nodeValue)
        {
            var node = new ListNode(nodeValue);

            return(Search(node));
        }