///<summary> ///Print all nodes from start to end. ///</summary> public void PrintAllNodes(ShaKyList data) { Console.WriteLine("Head"); Node curr = data.head; while (curr.Next != null) { curr = curr.Next; Console.WriteLine(curr.Value); } Console.WriteLine("Null"); }
/// <summary> /// Prints all nodes in reverse order /// </summary> public void PrintReverse() { int count = 0; Node curr = head; ShaKyList reverseList = new ShaKyList(); while (count < Count) { if (curr != null && curr.Next != null) { curr = curr.Next; reverseList.Add(curr.Value); } count++; } reverseList.PrintAllNodes(reverseList); }