/// <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> /// Print all data values in the linked list /// </summary> public void PrintList() { current = m_header; do { Console.WriteLine(current.GetData()); current = current.GetNext(); }while (!(current == m_header)); }
/// <summary> /// This private method is used to run a search through the linked list to find an object specified in Item /// </summary> /// <param name="Item">Generic object that is searched for in the Linked list</param> /// <returns>Generic node used in other methods</returns> private DoubleNode<T> Find(T Item) { current = m_header; while ((!(current.GetData().Equals(Item)) && (!(current.GetNext() == null)))) { current = current.GetNext(); } if (!current.GetData().Equals(Item)) { current = null; } return current; }