示例#1
0
 public void Insert(Conjunct newConjunct)
 {
     if (!ListOfConjuncts.Contains(newConjunct))
     {
         ListOfConjuncts.Add(newConjunct);
     }
 }
示例#2
0
        public bool Contains(Conjunct conj)
        {
            var current = Head;

            while (current != null)
            {
                if (current.Data.Equals(conj))
                {
                    return(true);
                }
                current = current.Next;
            }
            return(false);
        }
示例#3
0
        public void Add(Conjunct item)

        {
            Node node = new Node()
            {
                Data = item
            };

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

            Count++;
        }
示例#4
0
        public bool Remove(Conjunct item)
        {
            Node previous = null;

            Node current = Head;

            while (current != null)
            {
                if (current.Data.Equals(item))
                {
                    if (previous != null)
                    {
                        previous.Next = current.Next;
                        if (current.Next == null)
                        {
                            Tail = previous;
                        }
                    }
                    else
                    {
                        Head = Head.Next;
                        if (Head == null)
                        {
                            Tail = null;
                        }
                    }

                    Count--;
                    return(true);
                }

                previous = current;
                current  = current.Next;
            }
            return(false);
        }
示例#5
0
 public Node(Conjunct value)
 {
     Data = value;
 }