public void Insert(Conjunct newConjunct) { if (!ListOfConjuncts.Contains(newConjunct)) { ListOfConjuncts.Add(newConjunct); } }
public bool Contains(Conjunct conj) { var current = Head; while (current != null) { if (current.Data.Equals(conj)) { return(true); } current = current.Next; } return(false); }
public void Add(Conjunct item) { Node node = new Node() { Data = item }; if (Head == null) { Head = Tail = node; } else { Tail.Next = node; Tail = node; } Count++; }
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); }
public Node(Conjunct value) { Data = value; }