void SpecialCreate() { counter = 0; BinaryTreeLinkList <int> .Vertex r = (BinaryTreeLinkList <int> .Vertex) this.AddVertex(counter++); this._Root = r; MakeIt(this.MakeSize, r); }
public DepthFirstInorderTraversal(BinaryTreeLinkList <T> g, T s) { graph = g; Source = s; foreach (T v in graph.Vertices) { Visited.Add(v, false); } }
void MakeIt(int current_height, BinaryTreeLinkList <int> .Vertex current_node) { if (current_height == 0) { return; } current_height--; BinaryTreeLinkList <int> .Vertex l = (BinaryTreeLinkList <int> .Vertex) this.AddVertex(counter++); BinaryTreeLinkList <int> .Vertex r = (BinaryTreeLinkList <int> .Vertex) this.AddVertex(counter++); this.AddEdge(current_node, l); MakeIt(current_height, current_node.Left); this.AddEdge(current_node, r); MakeIt(current_height, current_node.Right); }