예제 #1
0
        public bool Contains(Object obj)
        {
            ClubMember cm   = obj as ClubMember;
            Node       temp = new Node();

            temp = Head;

            while (temp.Next != null)
            {
                if (cm.Equals(temp.Data))
                {
                    return(true);
                }
                temp = temp.Next;
            }
            return(false);
        }
예제 #2
0
        public int IndexOf(object obj)
        {
            ClubMember cm      = obj as ClubMember;
            Node       temp    = new Node();
            int        counter = 0;

            temp = Head;

            while (temp.Next != null)
            {
                counter++;
                if (cm.Equals(temp.Data))
                {
                    return(counter);
                }
                temp = temp.Next;
            }
            return(-1);
        }