/// <summary>
 /// This is the same as above but instead prints the list in reverse
 /// </summary>
 public void PrintReverse()
 {
     current = FindLast();
     while (!(current.GetPrev() == null))
     {
         Console.WriteLine(current.GetData().ToString());
         current = current.GetPrev();
     }
 }
 /// <summary>
 /// This method will remove the given Item from the list and ajust all links
 /// </summary>
 /// <param name="Item">Item to be removed</param>
 public void Remove(T Item)
 {
     DoubleNode<T> p = Find(Item);
     if (!(current.GetNext() == null))
     {
         p.GetPrev().SetNext(p.GetNext());
         p.GetNext().SetPrev(p.GetPrev());
         p.SetNext(null);
         p.SetPrev(null);
     }
 }
예제 #3
0
        /// <summary>
        /// This method will remove the given Item from the list and ajust all links
        /// </summary>
        /// <param name="Item">Item to be removed</param>
        public void Remove(T Item)
        {
            DoubleNode <T> p = FindPrevious(Item);

            if (!(p.GetNext() == m_header))
            {
                p.GetPrev().SetNext(p.GetNext());
                p.GetNext().SetPrev(p.GetPrev());
                p.SetNext(null);
                p.SetPrev(null);
            }
        }
예제 #4
0
 /// <summary>
 /// This method is used to check if the circularlist is empty of not
 /// </summary>
 /// <returns>Boolean value of true or false</returns>
 public bool IsEmpty()
 {
     return((m_header.GetNext() == null) && (m_header.GetPrev() == null));
 }