// // Summary: // Gets the number of elements contained in the Current Linked List. // // Returns: // The number of elements contained in the Current Linked List. public int Depth() { int counter = 1; LinkedL tmp = LINK; if (tmp != null) { counter++; while (tmp.HasNext()) { tmp = tmp.GetNext(); counter++; } } return(counter); }
// // Summary: // Gets the list of elements contained in the Current Linked List. // // Returns: // The list of elements contained in the Current Linked List. public string[] PreviousList() { string[] list = new string[this.Depth()]; int counter = 0; LinkedL tmp = LINK; list[counter] = (this.linkID.ToString().PadLeft(8, ' ')); if (tmp != null) { counter++; list[counter] = (tmp.linkID.ToString().PadLeft(8, ' ')); while (tmp.HasNext()) { counter++; tmp = tmp.GetNext(); list[counter] = (tmp.linkID.ToString().PadLeft(8, ' ')); } } return(list); }