Open kimmidi opened 3 years ago
How does one decide the way the tree is traversed as there are several ways to traverse the tree?
I'm not sure I understand your question. If there are several matches for the provided path due to wildcards, every matching node's children are visited.
How is the tree traversed in the current implementation? (reference: https://en.wikipedia.org/wiki/Tree_traversal#Types) depth first? pre-order? post-order? in-order?
It's not a complete tree traversal for the Visit methods, so it's not a clear answer. I'd characterize it more as BFS, as the ordering amongst child nodes is not guaranteed due to it being a map. The root certainly before the children.
But I don't see the connection with this pull request ?
But I don't see the connection with this pull request ?
I suppose this functionality is added for clients to use. Some clients might know how is the tree traversal is happening (or do it in a specific way) based on what they're doing, hence my question.
I suppose this functionality is added for clients to use. Some clients might know how is the tree traversal is happening (or do it in a specific way) based on what they're doing, hence my question.
OK. There are no guarantees wrt the order within the children nodes.
The data structure internally maintains a list of children of the node.