Message from JavaScript discussions
May 2017
— "A depth-first search starting at A, assuming that the left edges in the shown graph are chosen before right edges, and assuming the search remembers previously-visited nodes and will not repeat them (since this is a small graph), will visit the nodes in the following order: A, B, D, F, E, C, G. The edges traversed in this search form a Trémaux tree, a structure with important applications in graph theory"
In that example, on first iteration, the caller would get this object:
{
tuple: {
original: {
aa: {},
ab: {},
ac: {}
},
search: {
aa: {},
ab: {},
ac: {}
}
},
loc: "aa",
existing: null,
isContainer: true,
isLast: false
}
— Per iteration would look similar, but the tuple will be the object being iterated and loc will be the accessor
— How is this different from depth first
— Its not
— Uhm
— Order of iteration is bfs while order of traversal is dfs
— Hmm
— Iteration is not the same process as traversal?
— No
— Hmm
— Traversal is the process of adding a node to the stack, then iterating it's properties