private string StringForm(string data) { SGLArrayList <SGLNode <T> > SGLNodes = new SGLArrayList <SGLNode <T> >(); SGLNode <T> temp = Front; int index = 0; while (temp != null) { SGLNodes.Add(temp); temp = temp.GetNext(); data = data + SGLNodes.Get(index).ToString() + (temp == null ? "" : ", "); index++; } Front = SGLNodes.Get(0); return(data); }
/// <summary> /// Returns an SGLNode at the given index associated with the current SGLNode. /// </summary> /// <param name="index"></param> /// <returns></returns> public SGLNode <T> GetNode(int index) { return(AdjacencyList.Get(index).EndingVertex()); }
/// <summary> /// Returns a vertex at the given index in the list of vertices /// associated with this graph. /// </summary> /// <param name="index"></param> public SGLNode <T> GetVertexAt(int index) { return(Vertices.Get(index)); }